Skip to content

Instantly share code, notes, and snippets.

@maffan91
Created August 24, 2019 14:46
Show Gist options
  • Save maffan91/76ff5190b128de84b2aa8481a2613ef9 to your computer and use it in GitHub Desktop.
Save maffan91/76ff5190b128de84b2aa8481a2613ef9 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
class NavDrawer extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
DrawerHeader(
child: Text(
'Side menu',
style: TextStyle(color: Colors.white, fontSize: 25),
),
decoration: BoxDecoration(
color: Colors.green,
image: DecorationImage(
fit: BoxFit.fill,
image: AssetImage('assets/images/cover.jpg'))),
),
ListTile(
leading: Icon(Icons.input),
title: Text('Welcome'),
onTap: () => {},
),
ListTile(
leading: Icon(Icons.verified_user),
title: Text('Profile'),
onTap: () => {Navigator.of(context).pop()},
),
ListTile(
leading: Icon(Icons.settings),
title: Text('Settings'),
onTap: () => {Navigator.of(context).pop()},
),
ListTile(
leading: Icon(Icons.border_color),
title: Text('Feedback'),
onTap: () => {Navigator.of(context).pop()},
),
ListTile(
leading: Icon(Icons.exit_to_app),
title: Text('Logout'),
onTap: () => {Navigator.of(context).pop()},
),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment