如何从Firebase获取currentUser的详细信息? (使用Firebase中的数据填充占位符。)
我想获取currentUser
的displayName和电子邮件,并用Placeholder1(用户名),Placeholder2(login@comapany.com)替换
new UserAccountsDrawerHeader(
accountName: new Text(
"User name",//Placeholder 1
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15.0),
),
accountEmail: new Text(
"login@company.com", //Placeholder 2
style: TextStyle(
fontStyle: FontStyle.italic,
fontSize: 14.0,
color: Color(0xFFDEB992)),
),
答案 0 :(得分:0)
创建方法template<class T>
void insert_differences(T& container)
{
for(auto it : container){
// do some operations here
//advance(it,1);
it = next(it);
// do some operations here
//advance(it, -1);
it = prev(it);
}
}
:
getUserData()
然后使用Future<AuthResult> getUserData() async{
return await FirebaseAuth.instance.currentUser();
}
显示FutureBuilder
和email
: