Skip to content

Instantly share code, notes, and snippets.

@rohan20
Created August 14, 2018 08:46
Show Gist options
  • Save rohan20/791ba799873188a5285a1ee136a60837 to your computer and use it in GitHub Desktop.
Save rohan20/791ba799873188a5285a1ee136a60837 to your computer and use it in GitHub Desktop.
Flutter Facebook login
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