我想在应用程序栏(导航栏)下创建一个按钮,但按钮的大小不是正常大小,但不能太大。它必须在右上角,图标将在右边,如“Categories(List Icon)”(类别(列表图标))
最佳答案
我不知道你到底想要什么。如前所述,您可以使用 endDrawer
否则,如屏幕截图中所示,您可以执行以下操作,
Scaffold(
appBar: AppBar(title: Text('Category Demo')),
body: Column(children: [
Row(mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
width: 130.0,
child: FlatButton(
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => Categories()));
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("Categories"),
Icon(Icons.menu),
]
),
),
)
])
]),
);
输出:希望行得通!
关于flutter - 如何在Flutter上的应用栏下方右上角创建带有图标的按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63523425/