答案 0 :(得分:8)
按照flutter docs中的说明进行操作。
new AppBar(
title: new Text('My Fancy Dress'),
actions: <Widget>[
new IconButton( icon: new Icon(Icons.playlist_play), tooltip: 'Air it', onPressed: _airDress, ),],
leading: <Widget>[
new IconButton( icon: new Icon(Icons.playlist_play), tooltip: 'Air it', onPressed: _airDress, ),
], )
最下面的小部件是抽屉,而下面的小部件是搜索图标按钮。
答案 1 :(得分:0)
您可以尝试使用此代码。...
appBar: AppBar(
leading: Builder(
builder: (BuildContext context){
return IconButton(
icon: Icon(Icons.menu),
onPressed: () {
},
);
}),
title: Text("Flutter App"),
actions: <Widget>[
IconButton(
icon: Icon(Icons.search),
onPressed: () {
},
),
IconButton(
icon: Icon(Icons.search),
onPressed: () {
},
)
],
),
答案 2 :(得分:0)
这是最简单的
appBar: AppBar(
actions: <Widget>[
IconButton(
icon: Icon(Icons.search),
onPressed: () {},
),
IconButton(
icon: Icon(Icons.person),
onPressed: () {
},
)
],
centerTitle: true,
backgroundColor: Colors.red,
title: Text(
"Your title",
style: TextStyle(
color: Colors.white,
fontSize: 30,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.italic,
),
),
),