我的AppBar动作IconButton被溢出了。
likesCount参数随时间而变化。
如何使用IconButton在AppBar操作中动态防止溢出?
我的代码:
appBar: AppBar(
actions: [
IconButton(
onPressed: () {},
icon: Row(
children: [
Text("$likesCount"), <---- overflow in big numbers
const Icon(Icons.favorite_border),
],
),
),
],
),发布于 2022-05-02 14:17:13
你也有必要点击课文吗?因为你可以这样做:
AppBar(
actions: [
Row(
children: [
Text("155.55"),
IconButton(
onPressed: () {},
icon: Icon(Icons.favorite_border),
),
],
)
],
),使行同时具有文本和IconButton
如果您希望图标和文本更接近,只需将其添加到IconButton中即可。
constraints: BoxConstraints(),
padding: EdgeInsets.zero,https://stackoverflow.com/questions/72087903
复制相似问题