Skip to content

Commit 649e1da

Browse files
committed
theme 調整
1 parent eca0d3f commit 649e1da

File tree

3 files changed

+42
-33
lines changed

3 files changed

+42
-33
lines changed

packages/app/lib/foundation/build_context_exe.dart

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ extension BuildContextExt on BuildContext {
2020

2121
FlutterView get view => View.of(this);
2222

23-
ColorScheme get color => Theme.of(this).colorScheme;
23+
ColorScheme get color => ColorScheme.fromSeed(
24+
seedColor: Colors.green,
25+
brightness: Theme.of(this).brightness,
26+
);
2427

2528
TextTheme get text => Theme.of(this).textTheme;
2629
}
@@ -46,153 +49,153 @@ extension TextStyleExt on TextStyle {
4649

4750
TextStyle get lightPrimary => copyWith(
4851
color: ColorScheme.fromSeed(
49-
seedColor: Colors.blue,
52+
seedColor: Colors.green,
5053
).primary,
5154
);
5255

5356
TextStyle get lightOnPrimary => copyWith(
54-
color: ColorScheme.fromSeed(seedColor: Colors.blue).onPrimary,
57+
color: ColorScheme.fromSeed(seedColor: Colors.green).onPrimary,
5558
);
5659

5760
TextStyle get lightPrimaryContainer => copyWith(
58-
color: ColorScheme.fromSeed(seedColor: Colors.blue).primaryContainer,
61+
color: ColorScheme.fromSeed(seedColor: Colors.green).primaryContainer,
5962
);
6063

6164
TextStyle get lightOnPrimaryContainer => copyWith(
6265
color: ColorScheme.fromSeed(
63-
seedColor: Colors.blue,
66+
seedColor: Colors.green,
6467
).onPrimaryContainer,
6568
);
6669

6770
TextStyle get lightSecondary => copyWith(
6871
color: ColorScheme.fromSeed(
69-
seedColor: Colors.blue,
72+
seedColor: Colors.green,
7073
).secondary,
7174
);
7275

7376
TextStyle get lightOnSecondary => copyWith(
74-
color: ColorScheme.fromSeed(seedColor: Colors.blue).onSecondary,
77+
color: ColorScheme.fromSeed(seedColor: Colors.green).onSecondary,
7578
);
7679

7780
TextStyle get lightSecondaryContainer => copyWith(
78-
color: ColorScheme.fromSeed(seedColor: Colors.blue).secondaryContainer,
81+
color: ColorScheme.fromSeed(seedColor: Colors.green).secondaryContainer,
7982
);
8083

8184
TextStyle get lightOnSecondaryContainer => copyWith(
8285
color: ColorScheme.fromSeed(
83-
seedColor: Colors.blue,
86+
seedColor: Colors.green,
8487
).onSecondaryContainer,
8588
);
8689

8790
TextStyle get lightTertiary => copyWith(
8891
color: ColorScheme.fromSeed(
89-
seedColor: Colors.blue,
92+
seedColor: Colors.green,
9093
).tertiary,
9194
);
9295

9396
TextStyle get lightOnTertiary => copyWith(
94-
color: ColorScheme.fromSeed(seedColor: Colors.blue).onTertiary,
97+
color: ColorScheme.fromSeed(seedColor: Colors.green).onTertiary,
9598
);
9699

97100
TextStyle get lightTertiaryContainer => copyWith(
98-
color: ColorScheme.fromSeed(seedColor: Colors.blue).tertiaryContainer,
101+
color: ColorScheme.fromSeed(seedColor: Colors.green).tertiaryContainer,
99102
);
100103

101104
TextStyle get lightOnTertiaryContainer => copyWith(
102105
color: ColorScheme.fromSeed(
103-
seedColor: Colors.blue,
106+
seedColor: Colors.green,
104107
).onTertiaryContainer,
105108
);
106109

107110
TextStyle get lightError => copyWith(
108111
color: ColorScheme.fromSeed(
109-
seedColor: Colors.blue,
112+
seedColor: Colors.green,
110113
).error,
111114
);
112115

113116
TextStyle get lightOnError => copyWith(
114-
color: ColorScheme.fromSeed(seedColor: Colors.blue).onError,
117+
color: ColorScheme.fromSeed(seedColor: Colors.green).onError,
115118
);
116119

117120
TextStyle get lightErrorContainer => copyWith(
118-
color: ColorScheme.fromSeed(seedColor: Colors.blue).errorContainer,
121+
color: ColorScheme.fromSeed(seedColor: Colors.green).errorContainer,
119122
);
120123

121124
TextStyle get lightOnErrorContainer => copyWith(
122125
color: ColorScheme.fromSeed(
123-
seedColor: Colors.blue,
126+
seedColor: Colors.green,
124127
).onErrorContainer,
125128
);
126129

127130
TextStyle get lightOutline => copyWith(
128131
color: ColorScheme.fromSeed(
129-
seedColor: Colors.blue,
132+
seedColor: Colors.green,
130133
).outline,
131134
);
132135

133136
TextStyle get lightOutlineVariant => copyWith(
134-
color: ColorScheme.fromSeed(seedColor: Colors.blue).outlineVariant,
137+
color: ColorScheme.fromSeed(seedColor: Colors.green).outlineVariant,
135138
);
136139

137140
TextStyle get lightBackgroundContainer => copyWith(
138-
color: ColorScheme.fromSeed(seedColor: Colors.blue).background,
141+
color: ColorScheme.fromSeed(seedColor: Colors.green).background,
139142
);
140143

141144
TextStyle get lightOnBackground => copyWith(
142145
color: ColorScheme.fromSeed(
143-
seedColor: Colors.blue,
146+
seedColor: Colors.green,
144147
).onBackground,
145148
);
146149

147150
TextStyle get lightSurface => copyWith(
148151
color: ColorScheme.fromSeed(
149-
seedColor: Colors.blue,
152+
seedColor: Colors.green,
150153
).surface,
151154
);
152155

153156
TextStyle get lightOnSurface => copyWith(
154-
color: ColorScheme.fromSeed(seedColor: Colors.blue).onSurface,
157+
color: ColorScheme.fromSeed(seedColor: Colors.green).onSurface,
155158
);
156159

157160
TextStyle get lightSurfaceVariant => copyWith(
158-
color: ColorScheme.fromSeed(seedColor: Colors.blue).surfaceVariant,
161+
color: ColorScheme.fromSeed(seedColor: Colors.green).surfaceVariant,
159162
);
160163

161164
TextStyle get lightOnSurfaceVariant => copyWith(
162165
color: ColorScheme.fromSeed(
163-
seedColor: Colors.blue,
166+
seedColor: Colors.green,
164167
).onSurfaceVariant,
165168
);
166169

167170
TextStyle get lightInverseSurface => copyWith(
168171
color: ColorScheme.fromSeed(
169-
seedColor: Colors.blue,
172+
seedColor: Colors.green,
170173
).inverseSurface,
171174
);
172175

173176
TextStyle get lightOnInverseSurface => copyWith(
174-
color: ColorScheme.fromSeed(seedColor: Colors.blue).onInverseSurface,
177+
color: ColorScheme.fromSeed(seedColor: Colors.green).onInverseSurface,
175178
);
176179

177180
TextStyle get lightInversePrimary => copyWith(
178-
color: ColorScheme.fromSeed(seedColor: Colors.blue).inversePrimary,
181+
color: ColorScheme.fromSeed(seedColor: Colors.green).inversePrimary,
179182
);
180183

181184
TextStyle get lightShadow => copyWith(
182185
color: ColorScheme.fromSeed(
183-
seedColor: Colors.blue,
186+
seedColor: Colors.green,
184187
).shadow,
185188
);
186189

187190
TextStyle get lightScrim => copyWith(
188191
color: ColorScheme.fromSeed(
189-
seedColor: Colors.blue,
192+
seedColor: Colors.green,
190193
).scrim,
191194
);
192195

193196
TextStyle get lightSurfaceTint => copyWith(
194197
color: ColorScheme.fromSeed(
195-
seedColor: Colors.blue,
198+
seedColor: Colors.green,
196199
).surfaceTint,
197200
);
198201
}

packages/app/lib/main.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ class MyApp extends HookConsumerWidget {
3030

3131
return MaterialApp.router(
3232
theme: ThemeData(
33-
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
33+
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green),
34+
useMaterial3: true,
35+
),
36+
darkTheme: ThemeData(
37+
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green),
3438
useMaterial3: true,
3539
),
3640
supportedLocales: L10n.supportedLocales,

packages/app/lib/ui/screen/slide/component/custom_slide_builder.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ Widget Function(BuildContext) customSlideBuilder({
2020
width: context.slideSize.width,
2121
child: AutoSizeText(
2222
title,
23-
style: context.text.displayLarge?.bold,
23+
style: context.text.displayLarge?.semiBold.copyWith(
24+
color: context.color.primary,
25+
),
2426
),
2527
),
2628
),

0 commit comments

Comments
 (0)