Skip to content

Instantly share code, notes, and snippets.

@pradeeprjth
Created August 31, 2020 09:55
Show Gist options
  • Save pradeeprjth/ed6e2246081bb7f8ee76d647978b9845 to your computer and use it in GitHub Desktop.
Save pradeeprjth/ed6e2246081bb7f8ee76d647978b9845 to your computer and use it in GitHub Desktop.
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