-
-
Save ijoschek/c477fccdd5ccd94baa5b2c8746ba0421 to your computer and use it in GitHub Desktop.
flutter_auth_tut
This file contains 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
//... | |
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