Do it as stated in the 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, ),
], )
Where the widget under leading is the drawer and the one under actions is the search iconbutton.
You can try this code....
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: () {
},
)
],
),
This is the simplest
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,
),
),
),
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.