From 4cdcdcd982c8d1be5945725d838177a430373cf7 Mon Sep 17 00:00:00 2001 From: ahnjuseong <ahnjuseong@ajou.ac.kr> Date: Wed, 5 Jun 2024 20:09:10 +0900 Subject: [PATCH] =?UTF-8?q?5=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 --- .../assign/lib/main.dart | 62 ++++++++++++++----- 1 file changed, 48 insertions(+), 14 deletions(-) diff --git a/.github/workflows/flutter_application_1/assign/lib/main.dart b/.github/workflows/flutter_application_1/assign/lib/main.dart index e6ed70be00..ce149e5328 100644 --- a/.github/workflows/flutter_application_1/assign/lib/main.dart +++ b/.github/workflows/flutter_application_1/assign/lib/main.dart @@ -17,7 +17,7 @@ class MyApp extends StatelessWidget { title: 'Namer App', theme: ThemeData( useMaterial3: true, - colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepOrange), + colorScheme: ColorScheme.fromSeed(seedColor: Colors.yellow), ), home: MyHomePage(), ), @@ -38,21 +38,55 @@ class MyHomePage extends StatelessWidget { @override Widget build(BuildContext context) { var appState = context.watch<MyAppState>(); + var pair = appState.current; return Scaffold( - body: Column( - children: [ - Text('A random AWESOME idea:'), // ← Example change. - Text(appState.current.asLowerCase), - // ↓ Add this. - ElevatedButton( - onPressed: () { - appState.getNext(); // ← This instead of print(). - }, - child: Text('Next'), - ), - - ], + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + BigCard(pair: pair), + SizedBox(height: 10), + ElevatedButton( + onPressed: () { + appState.getNext(); + }, + child: Text('Next'), + ), + + ], + ), + ), + ); + } +} + +class BigCard extends StatelessWidget { + const BigCard({ + super.key, + required this.pair, + }); + + final WordPair pair; + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + // ↓ Add this. + final style = theme.textTheme.displayMedium!.copyWith( + color: theme.colorScheme.onPrimary, + ); + + return Card( + color: theme.colorScheme.primary, + child: Padding( + padding: const EdgeInsets.all(20), + // ↓ Change this line. + child: Text( + pair.asLowerCase, + style: style, + semanticsLabel: "${pair.first} ${pair.second}", + ), ), ); } -- GitLab