Skip to content

Instantly share code, notes, and snippets.

@viveky259259
Last active October 7, 2019 11:03
Show Gist options
  • Save viveky259259/70d6e02535961c8cc3c57f405bfac5e4 to your computer and use it in GitHub Desktop.
Save viveky259259/70d6e02535961c8cc3c57f405bfac5e4 to your computer and use it in GitHub Desktop.
Flutter Drawer
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