Skip to content
Snippets Groups Projects
Commit 4cdcdcd9 authored by ahnjuseong's avatar ahnjuseong
Browse files

5단계 완료

parent 0b7e9fca
Branches
No related tags found
1 merge request!1Roll Packages from 611aea1657fb to 28d126c54c63 (1 revision) (#145690)
...@@ -17,7 +17,7 @@ class MyApp extends StatelessWidget { ...@@ -17,7 +17,7 @@ class MyApp extends StatelessWidget {
title: 'Namer App', title: 'Namer App',
theme: ThemeData( theme: ThemeData(
useMaterial3: true, useMaterial3: true,
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepOrange), colorScheme: ColorScheme.fromSeed(seedColor: Colors.yellow),
), ),
home: MyHomePage(), home: MyHomePage(),
), ),
...@@ -38,22 +38,56 @@ class MyHomePage extends StatelessWidget { ...@@ -38,22 +38,56 @@ class MyHomePage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var appState = context.watch<MyAppState>(); var appState = context.watch<MyAppState>();
var pair = appState.current;
return Scaffold( return Scaffold(
body: Column( body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text('A random AWESOME idea:'), // ← Example change. BigCard(pair: pair),
Text(appState.current.asLowerCase), SizedBox(height: 10),
// ↓ Add this.
ElevatedButton( ElevatedButton(
onPressed: () { onPressed: () {
appState.getNext(); // ← This instead of print(). appState.getNext();
}, },
child: Text('Next'), 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}",
),
),
); );
} }
} }
\ 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