From 735698bfaaf468f2ffac961321836417e10bc9bd Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Fri, 11 Jan 2019 19:51:43 +0100 Subject: [PATCH] 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. --- lib/widgets/app_drawer.dart | 28 +++++++++++++--------------- pubspec.yaml | 2 ++ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/widgets/app_drawer.dart b/lib/widgets/app_drawer.dart index cd3308ef..c1ffbe62 100644 --- a/lib/widgets/app_drawer.dart +++ b/lib/widgets/app_drawer.dart @@ -12,27 +12,25 @@ class AppDrawer extends StatelessWidget { // Important: Remove any padding from the ListView. padding: EdgeInsets.zero, children: [ - 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 // ... }, diff --git a/pubspec.yaml b/pubspec.yaml index b661da68..19024abd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,6 +19,8 @@ dev_dependencies: flutter: uses-material-design: true + assets: + - "assets/icon/icon.png" flutter_icons: android: "launcher_icon"