Skip to content
Snippets Groups Projects
Commit ce79b2d0 authored by Jingeun Lee's avatar Jingeun Lee
Browse files

4. 버튼 추가

parent ffefe1e6
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,11 @@ class MyApp extends StatelessWidget {
class MyAppState extends ChangeNotifier {
var current = WordPair.random();
void getNext() {
current = WordPair.random();
notifyListeners();
}
}
class MyHomePage extends StatelessWidget {
......@@ -35,7 +40,16 @@ class MyHomePage extends StatelessWidget {
return Scaffold(
body: Column(
children: [Text('A random idea:'), Text(appState.current.asLowerCase)],
children: [
Text('A random AWESOME idea:'),
Text(appState.current.asLowerCase),
ElevatedButton(
onPressed: () {
appState.getNext();
},
child: Text('Next'),
),
],
),
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment