Created
November 27, 2018 13:36
-
-
Save miyoyo/41f08fef5b9548a07dc1cf4d35abc149 to your computer and use it in GitHub Desktop.
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 MyWidget extends StatefulWidget { | |
@override | |
LoginState createState() { | |
return MyState(); | |
} | |
} | |
class MyState extends State<Login> { | |
int value = 0; | |
@override | |
Widget build(BuildContext context) => Scaffold( | |
appBar: AppBar( | |
title: Text('Flutter + Dartea = ❤'), | |
), | |
body: Center( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
crossAxisAlignment: CrossAxisAlignment.center, | |
children: <Widget>[ | |
Text( | |
'$value', | |
style: Theme.of(context).textTheme.display1, | |
), | |
Padding( | |
child: RaisedButton.icon( | |
label: Text('Increment'), | |
icon: Icon(Icons.add), | |
onPressed: () => setState(() => value++), | |
), | |
padding: EdgeInsets.all(5.0), | |
), | |
RaisedButton.icon( | |
label: Text('Decrement'), | |
icon: Icon(Icons.remove), | |
onPressed: () => setState(() => value--), | |
), | |
], | |
), | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment