【发布时间】:2018-10-14 09:19:14
【问题描述】:
有没有办法在颤动中将应用栏停靠在底部?
谢谢。
【问题讨论】:
有没有办法在颤动中将应用栏停靠在底部?
谢谢。
【问题讨论】:
AppBar 只是一个和其他小部件一样的小部件。你可以把它放在任何你想要的地方。
即使在Scaffold 的bottomNavigationBar 字段中。
final appBar = new AppBar(title: new Text("data"));
return new Scaffold(
body: new Center(
child: new FlatButton(
child: new Text("data"),
),
),
bottomNavigationBar: new SizedBox(
height: appBar.preferredSize.height,
child: appBar,
),
);
虽然在这种情况下你也可以使用BottomAppBar。
【讨论】: