Updated DrawerHeader and added UserAccountDrawer.

Removed old Stack layout and added a simple-to-extend interface for the
new drawer header. Also added a specialized UserAccountsDrawerHeader
consistent with Material Design guidelines.
This commit is contained in:
Dragos Tiselice
2016-07-18 14:24:06 -07:00
parent 5f7b89990e
commit 65e77142e9
10 changed files with 296 additions and 33 deletions

View File

@@ -121,7 +121,8 @@ class _PestoDemoState extends State<PestoDemo> {
child: new Block(
children: <Widget>[
new DrawerHeader(
content: new Column(
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new Container(
decoration: new BoxDecoration(
@@ -131,7 +132,7 @@ class _PestoDemoState extends State<PestoDemo> {
width: 72.0,
height: 72.0,
padding: const EdgeInsets.all(2.0),
margin: const EdgeInsets.only(bottom: 8.0),
margin: const EdgeInsets.only(bottom: 16.0),
child: new ClipOval(
child: new Image(
image: new AssetImage(_kUserImage),

View File

@@ -49,7 +49,7 @@ class GalleryDrawer extends StatelessWidget {
child: new Block(
children: <Widget>[
new DrawerHeader(
content: new Center(child: new Text('Flutter gallery'))
child: new Center(child: new Text('Flutter gallery'))
),
new DrawerItem(
icon: new Icon(Icons.brightness_5),

View File

@@ -124,7 +124,7 @@ class StockHomeState extends State<StockHome> {
Widget _buildDrawer(BuildContext context) {
return new Drawer(
child: new Block(children: <Widget>[
new DrawerHeader(content: new Center(child: new Text('Stocks'))),
new DrawerHeader(child: new Center(child: new Text('Stocks'))),
new DrawerItem(
icon: new Icon(Icons.assessment),
selected: true,