diff --git a/.github/workflows/flutter_application_1/assign/lib/main.dart b/.github/workflows/flutter_application_1/assign/lib/main.dart index e6ed70be006858b4a5370b48e8eccef31dab7364..ce149e53284699d9ceb9173bd38af3e8efeffc31 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}", + ), ), ); }