Reputation: 29
I want to create a button under the appbar (navbar) with a button not too big just normal size but I couldn't. It needs to be on top right and icon will be on the right like "Categories(List Icon)"
Upvotes: 0
Views: 633
Reputation: 4923
I don't know how exactly you want it to be. As mentioned you can use endDrawer
or else, like in the screenshot, you can do something like this,
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),
]
),
),
)
])
]),
);
Output:
Hope that works!
Upvotes: 1
Reputation: 337
You can try endDrawer in Scaffold from this example: https://api.flutter.dev/flutter/material/Scaffold/endDrawer.html
Upvotes: 0