Created
August 14, 2018 08:46
-
-
Save rohan20/791ba799873188a5285a1ee136a60837 to your computer and use it in GitHub Desktop.
Flutter Facebook login
This file contains hidden or 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
bool isLoggedIn = false; | |
void onLoginStatusChanged(bool isLoggedIn) { | |
setState(() { | |
this.isLoggedIn = isLoggedIn; | |
}); | |
} | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text("Facebook Login"), | |
), | |
body: Container( | |
child: Center( | |
child: isLoggedIn | |
? Text("Logged In") | |
: RaisedButton( | |
child: Text("Login with Facebook"), | |
onPressed: () => initiateFacebookLogin(), | |
), | |
), | |
), | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment