I want to get the email of currently logged in user in accountEmail field. But it is displaying Instance of 'Future' in place of email. Below is the function to get the id of currently logged in user:
Future <String> getUserId() async{
FirebaseUser user = await FirebaseAuth.instance.currentUser();
return user.uid;
}
And in this way I am getting it:
new UserAccountsDrawerHeader(
accountName: new Text("Admin"),
accountEmail: new Text(getUserId().toString()),
),
I am new to flutter and any help would be highly appreciated.