Instantly share code, notes, and snippets.

@ijoschek ijoschek/.\lib\scr\home.dart Secret
Last active Dec 5, 2018

Embed
What would you like to do?
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