Files
GitJournal/lib/widgets/app_drawer.dart
Vishesh Handa 735698bfaa 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.
2019-01-11 19:51:43 +01:00

43 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
class AppDrawer extends StatelessWidget {
@override
Widget build(BuildContext context) {
// TODO: implement build
return new Drawer(
// Add a ListView to the drawer. This ensures the user can scroll
// through the options in the Drawer if there isn't enough vertical
// space to fit everything.
child: new ListView(
// Important: Remove any padding from the ListView.
padding: EdgeInsets.zero,
children: <Widget>[
new DrawerHeader(
decoration: new BoxDecoration(
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('Share App'),
onTap: () {
Navigator.pop(context);
// Update the state of the app
// ...
},
),
],
),
);
}
}