From f1bbba59ab22bcded8cbc774252efaa6a776d988 Mon Sep 17 00:00:00 2001 From: Jingeun Lee <exploitsori@ajou.ac.kr> Date: Wed, 16 Apr 2025 18:32:26 +0900 Subject: [PATCH] =?UTF-8?q?5.=20=EB=8D=94=20=EB=A9=8B=EC=A7=84=20=EC=95=B1?= =?UTF-8?q?=20=EB=A7=8C=EB=93=A4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main.dart | 52 ++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index a8e3041..831f8c3 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -37,19 +37,49 @@ 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:'), - Text(appState.current.asLowerCase), - ElevatedButton( - onPressed: () { - appState.getNext(); - }, - 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); + final style = theme.textTheme.displayMedium!.copyWith( + color: theme.colorScheme.onPrimary, + ); + + return Card( + color: theme.colorScheme.primary, + child: Padding( + padding: const EdgeInsets.all(20), + child: Text( + pair.asLowerCase, + style: style, + semanticsLabel: "${pair.first} ${pair.second}", + ), ), ); } -- GitLab