diff --git a/lib/main.dart b/lib/main.dart index a8e30418ac525284b6e69c2834bcadb6c7d3369c..831f8c3ee52bc3e2df019bbf3b1cce0e01098b20 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}", + ), ), ); }