Skip to content

Instantly share code, notes, and snippets.

@Gogetter
Last active May 27, 2018 19:20
Show Gist options
  • Save Gogetter/d5d91ed638b473e1ee4158657f626406 to your computer and use it in GitHub Desktop.
Save Gogetter/d5d91ed638b473e1ee4158657f626406 to your computer and use it in GitHub Desktop.
adding UserAccountsDrawerHeader to Drawer
return new Scaffold(
appBar: new AppBar(
)
),
drawer: new Drawer(
child: new ListView(
children: <Widget>[
//display current user info
new UserAccountsDrawerHeader(
decoration: new BoxDecoration(color: Colors.white),
currentAccountPicture: new CircleAvatar(
backgroundImage: currentUser.photoUrl.isNotEmpty ?
new NetworkImage(currentUser.photoUrl) : currentUser.displayName.substring(0)),
accountName: new Text('Welcome, ${currentUser.displayName}', style: _userInfoTxtStyle),
accountEmail: new Text(currentUser.email?? '', style: _userInfoTxtStyle)
),
],
),
),
body: new Center(
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment