Issue
How to place Drawer widget on the right. Also is possible to place two Drawer widget in a single page one either side of the appbar
Widget build(BuildContext context){
return Scaffold(
drawer: Drawer(
child: ListView(
children: <Widget>[
ListTile(
leading: Icon(Icons.shopping_cart),
title: Text('Checkout'),
onTap: (){
Navigator.pushNamed(context, '/home');
},
),
ListTile(
leading: Icon(Icons.report),
title: Text('Transactions'),
onTap: (){
Navigator.pushNamed(context, '/transactionsList');
},
),
]
)
),
body: SingleChildScrollView(
child: Column(
children : [
_buildOrderHeader(),
_buildOrderDetails(context),
]
)
)
);
}'
Solution
By using endDrawer: ...
instead or in addition to drawer: ...
to set a drawer, like this:
Scaffold(
endDrawer: Drawer(...),
// ...
)
To open it programmatically, use
Scaffold.of(context).openEndDrawer(); //This might have been updated by flutter team since the last edit
See also https://docs.flutter.io/flutter/material/Scaffold/endDrawer.html
Answered By - Günter Zöchbauer
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.