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.
padding: EdgeInsets.zero,
children: <Widget>[
new UserAccountsDrawerHeader(
accountEmail: new Text("me@vhanda.in"),
accountName: new Text("Vishesh Handa"),
new DrawerHeader(
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(
title: new Text('Item 1'),
title: new Text('Share App'),
onTap: () {
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
// ...
},

View File

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