I have some code like this :
Future<FirebaseUser> _getUser() async {
return await _fireAuth.currentUser();
}
bool get isSignedIn {
_getUser().then((value) {
return value != null;
}).catchError((err) {
print("Error While knowing isSignedIn --> $err");
});
}
Basically, how do I make the code wait while it's getting the data from the future function i.e _getUser() and then return the result via the getter i.e isSignedIn. Using this code the result of the isSignedIn getter is null
I'm still new in Flutter. Your help would be much appreciated.