Skip to content
Snippets Groups Projects
Commit f1bbba59 authored by Jingeun Lee's avatar Jingeun Lee
Browse files

5. 더 멋진 앱 만들기

parent ce79b2d0
No related branches found
No related tags found
No related merge requests found
......@@ -37,12 +37,15 @@ class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
var appState = context.watch<MyAppState>();
var pair = appState.current;
return Scaffold(
body: Column(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('A random AWESOME idea:'),
Text(appState.current.asLowerCase),
BigCard(pair: pair),
SizedBox(height: 10),
ElevatedButton(
onPressed: () {
appState.getNext();
......@@ -51,6 +54,33 @@ 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(20),
child: Text(
pair.asLowerCase,
style: style,
semanticsLabel: "${pair.first} ${pair.second}",
),
),
);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment