AppDrawer: Add the icon instead of my name + email

There doesn't seem to be any way to automatically get the name + email
of the user, so then there isn't anything to show. I'm adding the icon
as a placeholder. It's better than nothing.
This commit is contained in:
Vishesh Handa
2019-01-11 19:51:43 +01:00
parent 8a35470ad1
commit 735698bfaa
2 changed files with 15 additions and 15 deletions

View File

@ -12,27 +12,25 @@ class AppDrawer extends StatelessWidget {
// Important: Remove any padding from the ListView. // Important: Remove any padding from the ListView.
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
children: <Widget>[ children: <Widget>[
new UserAccountsDrawerHeader( new DrawerHeader(
accountEmail: new Text("me@vhanda.in"),
accountName: new Text("Vishesh Handa"),
decoration: new BoxDecoration( decoration: new BoxDecoration(
color: Colors.blue, color: Theme.of(context).accentColor,
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: DecoratedBox(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/icon/icon.png'),
),
),
),
), ),
), ),
new ListTile( new ListTile(
title: new Text('Item 1'), title: new Text('Share App'),
onTap: () { onTap: () {
Navigator.pop(context); Navigator.pop(context);
// Update the state of the app
// ...
},
),
new ListTile(
title: new Text('Item 2'),
onTap: () {
Navigator.pop(context);
// Update the state of the app // Update the state of the app
// ... // ...
}, },

View File

@ -19,6 +19,8 @@ dev_dependencies:
flutter: flutter:
uses-material-design: true uses-material-design: true
assets:
- "assets/icon/icon.png"
flutter_icons: flutter_icons:
android: "launcher_icon" android: "launcher_icon"