【发布时间】:2019-09-14 07:03:49
【问题描述】:
我已成功从 Firebase Auth 中检索到用户电子邮件和姓名。但我想在 Flutter Drawer 中显示这个
姓名和电子邮件检索:
Future<FirebaseUser> _handleSignIn() async {
final GoogleSignInAccount googleUser = await _googleSignIn.signIn();
final GoogleSignInAuthentication googleAuth = await googleUser.authentication;
final AuthCredential credential = GoogleAuthProvider.getCredential(
accessToken: googleAuth.accessToken,
idToken: googleAuth.idToken,
);
final FirebaseUser user = await _auth.signInWithCredential(credential);
print("signed in " + user.displayName);
print("signed in " + user.email);
return user;
}
颤振抽屉:
drawer: new Drawer(
elevation: 10.0,
child: new ListView(
children: <Widget>[
new UserAccountsDrawerHeader(
accountName: new Text("Name"), //I want to display user NAME here
accountEmail: new Text("Email"), //display user EMAIL here
decoration: new BoxDecoration(
image: new DecorationImage(
fit: BoxFit.fill,
image: new NetworkImage(
"https://img00.deviantart.net/35f0/i/2015/018/2/6/low_poly_landscape__the_river_cut_by_bv_designs-d8eib00.jpg"))),
),
【问题讨论】:
标签: firebase flutter firebase-authentication