Skip to content

Instantly share code, notes, and snippets.

@ijoschek
Last active December 5, 2018 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ijoschek/c477fccdd5ccd94baa5b2c8746ba0421 to your computer and use it in GitHub Desktop.
Save ijoschek/c477fccdd5ccd94baa5b2c8746ba0421 to your computer and use it in GitHub Desktop.
flutter_auth_tut
//...
class _Home extends State<StatefulWidget> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Flutter Authentication Tutorial'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Padding(
padding: EdgeInsets.symmetric(vertical: 9.0, horizontal: 18.0),
child: Text('User: $mUserName'),
),
Padding(
padding: EdgeInsets.symmetric(vertical: 9.0, horizontal: 18.0),
child: RaisedButton(
color: Colors.green,
textColor: Colors.white,
splashColor: Colors.greenAccent,
child: const Text('LOGIN'),
onPressed: isLoggingIn ? null : clickLogin),
),
Padding(
padding: EdgeInsets.symmetric(vertical: 9.0, horizontal: 18.0),
child: RaisedButton(
color: Colors.blue,
textColor: Colors.white,
splashColor: Colors.blueAccent,
child: const Text('LOGOUT'),
onPressed: isLoggingIn ? null : clickLogout),
),
Padding(
padding: EdgeInsets.symmetric(vertical: 9.0, horizontal: 18.0),
child: RaisedButton(
color: Colors.red,
textColor: Colors.white,
splashColor: Colors.redAccent,
child: const Text('DELETE'),
onPressed: mUser == null || isLoggingIn ? null : clickDelete,
),
),
Opacity(
opacity: cpbOpacity,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
CircularProgressIndicator(),
SizedBox(width: 20.0),
Text('Please wait...')
],
),
),
],
)),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment