Reputation: 1539
I am building a flutter app and I don't find how to show appbar above drawer. I saw many people asking this but anybody solved it.
Upvotes: 0
Views: 156
Reputation: 7601
Try this:
class _MyHomePageState extends State<MyHomePage> {
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: GestureDetector(
child: Text('OPEN'),
onTap: () {
_scaffoldKey.currentState.openDrawer();
}),
title: Text(widget.title),
),
body: Scaffold(
key: _scaffoldKey,
drawer: Drawer(),
body: Container(),
),
);
}
}
Upvotes: 1