From 0b7e9fca51f4e3f996d1e30097ec5c874bad6cdc Mon Sep 17 00:00:00 2001 From: ahnjuseong <ahnjuseong@ajou.ac.kr> Date: Wed, 5 Jun 2024 19:48:46 +0900 Subject: [PATCH] =?UTF-8?q?4=EB=8B=A8=EA=B3=84=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flutter_application_1/assign/lib/main.dart | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/flutter_application_1/assign/lib/main.dart b/.github/workflows/flutter_application_1/assign/lib/main.dart index 3ff5064120..e6ed70be00 100644 --- a/.github/workflows/flutter_application_1/assign/lib/main.dart +++ b/.github/workflows/flutter_application_1/assign/lib/main.dart @@ -27,6 +27,11 @@ class MyApp extends StatelessWidget { class MyAppState extends ChangeNotifier { var current = WordPair.random(); + // ↓ Add this. + void getNext() { + current = WordPair.random(); + notifyListeners(); + } } class MyHomePage extends StatelessWidget { @@ -37,8 +42,16 @@ class MyHomePage extends StatelessWidget { return Scaffold( body: Column( children: [ - Text('A random idea:'), + Text('A random AWESOME idea:'), // ← Example change. Text(appState.current.asLowerCase), + // ↓ Add this. + ElevatedButton( + onPressed: () { + appState.getNext(); // ← This instead of print(). + }, + child: Text('Next'), + ), + ], ), ); -- GitLab