Last active
October 7, 2019 11:03
-
-
Save viveky259259/70d6e02535961c8cc3c57f405bfac5e4 to your computer and use it in GitHub Desktop.
Flutter Drawer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class DrawerUi extends StatefulWidget { | |
@override | |
_DrawerUiState createState() => _DrawerUiState(); | |
} | |
class _DrawerUiState extends State<DrawerUi> { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('Drawer Example'), | |
), | |
body: Text('Drawer Example'), | |
drawer: Drawer( | |
child: ListView( | |
children: <Widget>[ | |
DrawerHeader( | |
child: Text('Drawer Header'), | |
decoration: BoxDecoration( | |
color: Colors.blue, | |
), | |
), | |
ListTile( | |
title: Text('Item 1'), | |
onTap: () { | |
// Update the state of the app. | |
// ... | |
}, | |
), | |
ListTile( | |
title: Text('Item 2'), | |
onTap: () { | |
// Update the state of the app. | |
// ... | |
}, | |
), | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment