diff --git a/namer_app/lib/main.dart b/namer_app/lib/main.dart index e0f3427..4f1d602 100644 --- a/namer_app/lib/main.dart +++ b/namer_app/lib/main.dart @@ -17,7 +17,7 @@ class MyApp extends StatelessWidget { title: 'Namer App (EXAMPLE PROJECT)', theme: ThemeData( useMaterial3: true, - colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepOrange), + colorScheme: ColorScheme.fromSeed(seedColor: Colors.purple), ), home: MyHomePage(), ), @@ -39,12 +39,13 @@ class MyHomePage extends StatelessWidget { @override Widget build(BuildContext context) { var appState = context.watch(); + var pair = appState.current; return Scaffold( body: Column( children: [ Text('A random wordpair:'), - Text(appState.current.asLowerCase), + BigCard(pair: pair), ElevatedButton( onPressed: () { appState.getNext(); @@ -57,3 +58,29 @@ class MyHomePage extends StatelessWidget { ); } } + +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(15.0), + child: Text(pair.asLowerCase, style: style), + ), + ); + } +}