-
-
Save ijoschek/88e44ec2138b6181f5497c38d996532c to your computer and use it in GitHub Desktop.
flutter_auth_tut
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _Home extends State<StatefulWidget> { | |
var mUser; | |
var mUserName; | |
var isLoggingIn = false; | |
Future clickLogin() async { | |
//Set isLoggingIn to true at the start of clicking Login | |
setState(() { | |
isLoggingIn = true; | |
}); | |
mUser = await loginWithGoogle().catchError((e) => setState(() { | |
isLoggingIn = false; | |
})); | |
assert(mUser != null); | |
setState(() { | |
isLoggingIn = false; | |
mUserName = mUser.displayName; | |
}); | |
} | |
@override | |
Widget build(BuildContext context) { | |
//... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment