Skip to content

Commit 2a6a271

Browse files
committed
fix: Theme generated from colorScheme and textTheme
1 parent 7e162a3 commit 2a6a271

File tree

2 files changed

+12
-23
lines changed

2 files changed

+12
-23
lines changed

client/lib/custom_theme.dart

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,17 @@ const _kHeadline1 = TextStyle(fontFamily: 'PermanentMarker', fontSize: 25);
1313
/// ```
1414
class CustomTheme extends ChangeNotifier {
1515
static ThemeData get lightTheme {
16-
final themeData = ThemeData();
17-
final colorScheme = themeData.colorScheme
18-
.copyWith(onPrimary: Colors.white, onBackground: Colors.black87);
19-
return _themeData(themeData, colorScheme);
16+
final colorScheme = ColorScheme.fromSwatch(backgroundColor: Colors.white);
17+
final textTheme =
18+
Typography.blackMountainView.copyWith(headline1: _kHeadline1);
19+
return ThemeData.from(colorScheme: colorScheme, textTheme: textTheme);
2020
}
2121

2222
static ThemeData get darkTheme {
23-
final themeData = ThemeData.dark();
24-
final colorScheme = themeData.colorScheme
25-
.copyWith(onPrimary: Colors.white, onBackground: Colors.white);
26-
return _themeData(themeData, colorScheme);
27-
}
28-
29-
static ThemeData _themeData(ThemeData baseTheme, ColorScheme colorScheme) {
30-
final textTheme = baseTheme.textTheme
31-
.copyWith(
32-
headline1: _kHeadline1,
33-
// main_screen에서 키워드에 사용됨
34-
subtitle2: TextStyle(
35-
fontSize: 14,
36-
color: colorScheme.onSurface.withAlpha(150),
37-
fontStyle: FontStyle.italic))
38-
.apply(displayColor: colorScheme.onBackground);
39-
40-
return baseTheme.copyWith(colorScheme: colorScheme, textTheme: textTheme);
23+
const colorScheme = ColorScheme.dark();
24+
final textTheme =
25+
Typography.whiteMountainView.copyWith(headline1: _kHeadline1);
26+
return ThemeData.from(colorScheme: colorScheme, textTheme: textTheme);
4127
}
4228

4329
bool _isDarkMode = false;

client/lib/widgets/main/pr12video.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ class PR12Video extends StatelessWidget {
3333
const SizedBox(height: 10),
3434
Text(
3535
getKeywords(video.keywords),
36-
style: Theme.of(context).textTheme.subtitle2,
36+
style: Theme.of(context)
37+
.textTheme
38+
.caption
39+
?.apply(fontStyle: FontStyle.italic),
3740
overflow: TextOverflow.ellipsis,
3841
),
3942
],

0 commit comments

Comments
 (0)