mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-12 13:51:38 +08:00
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user