I just updated Google Firebase Auth in Flutter app because I was getting some wried SDK errors but now I'm getting:
Error: 'currentUser' isn't a function or method and can't be invoked. User currentFirebaseUser = await FirebaseAuth.instance.currentUser();
I looked at the migration guide and understand that currentUser() is now synchronous via the currentUser getter. but I'm not sure how I should change my code now to fix this.
static void getCurrentUserInfo() async{
User currentFirebaseUser = await FirebaseAuth.instance.currentUser();
String userid = currentFirebaseUser.uid;
DatabaseReference userRef = FirebaseDatabase.instance.reference().child('users/$userid');
userRef.once().then((DataSnapshot snapshot){
if(snapshot.value != null){
}
});
}