Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-05-01 10:37:31 +08:00
parent 91a14d8286
commit d27f5f315c
71 changed files with 94 additions and 1561 deletions

View File

@@ -31,39 +31,9 @@ abstract final class ThemeUtils {
required bool isDynamic,
bool isDark = false,
}) {
final appFontWeight = Pref.appFontWeight.clamp(
-1,
FontWeight.values.length - 1,
);
final fontWeight = appFontWeight == -1
? null
: FontWeight.values[appFontWeight];
late final textStyle = TextStyle(fontWeight: fontWeight);
ThemeData themeData = ThemeData(
colorScheme: colorScheme,
useMaterial3: true,
textTheme: fontWeight == null
? null
: TextTheme(
displayLarge: textStyle,
displayMedium: textStyle,
displaySmall: textStyle,
headlineLarge: textStyle,
headlineMedium: textStyle,
headlineSmall: textStyle,
titleLarge: textStyle,
titleMedium: textStyle,
titleSmall: textStyle,
bodyLarge: textStyle,
bodyMedium: textStyle,
bodySmall: textStyle,
labelLarge: textStyle,
labelMedium: textStyle,
labelSmall: textStyle,
),
tabBarTheme: fontWeight == null
? null
: TabBarThemeData(labelStyle: textStyle),
appBarTheme: AppBarTheme(
elevation: 0,
titleSpacing: 0,
@@ -73,7 +43,6 @@ abstract final class ThemeUtils {
titleTextStyle: TextStyle(
fontSize: 16,
color: colorScheme.onSurface,
fontWeight: fontWeight,
),
),
navigationBarTheme: NavigationBarThemeData(
@@ -108,7 +77,6 @@ abstract final class ThemeUtils {
titleTextStyle: TextStyle(
fontSize: 18,
color: colorScheme.onSurface,
fontWeight: fontWeight,
),
backgroundColor: colorScheme.surface,
constraints: const BoxConstraints(minWidth: 280, maxWidth: 420),