mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
49
lib/app.dart
49
lib/app.dart
@@ -28,8 +28,7 @@ class MyApp extends StatelessWidget {
|
||||
// Issue #57
|
||||
// if not [ok] -> [AMOLED] mode, use [ThemeMode.dark]
|
||||
final themeMode = isAMOLED ? ThemeMode.values[tMode] : ThemeMode.dark;
|
||||
final localeStr = _setting.locale.fetch();
|
||||
final locale = localeStr?.toLocale;
|
||||
final locale = _setting.locale.fetch()?.toLocale;
|
||||
final darkTheme = ThemeData(
|
||||
useMaterial3: true,
|
||||
brightness: Brightness.dark,
|
||||
@@ -47,39 +46,25 @@ class MyApp extends StatelessWidget {
|
||||
useMaterial3: true,
|
||||
colorSchemeSeed: primaryColor,
|
||||
),
|
||||
darkTheme: isAMOLED
|
||||
? darkTheme
|
||||
: darkTheme.copyWith(
|
||||
scaffoldBackgroundColor: Colors.black,
|
||||
dialogBackgroundColor: Colors.black,
|
||||
drawerTheme: const DrawerThemeData(
|
||||
backgroundColor: Colors.black,
|
||||
),
|
||||
appBarTheme: const AppBarTheme(
|
||||
backgroundColor: Colors.black,
|
||||
),
|
||||
dialogTheme: const DialogTheme(
|
||||
backgroundColor: Colors.black,
|
||||
),
|
||||
bottomSheetTheme: const BottomSheetThemeData(
|
||||
backgroundColor: Colors.black,
|
||||
),
|
||||
listTileTheme: const ListTileThemeData(
|
||||
tileColor: Colors.black12,
|
||||
),
|
||||
cardTheme: const CardTheme(
|
||||
color: Colors.black12,
|
||||
),
|
||||
navigationBarTheme: const NavigationBarThemeData(
|
||||
backgroundColor: Colors.black,
|
||||
),
|
||||
popupMenuTheme: const PopupMenuThemeData(
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
darkTheme: isAMOLED ? darkTheme : _getAmoledTheme(darkTheme),
|
||||
home: fullScreen ? const FullScreenPage() : const HomePage(),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ThemeData _getAmoledTheme(ThemeData darkTheme) => darkTheme.copyWith(
|
||||
scaffoldBackgroundColor: Colors.black,
|
||||
dialogBackgroundColor: Colors.black,
|
||||
drawerTheme: const DrawerThemeData(backgroundColor: Colors.black),
|
||||
appBarTheme: const AppBarTheme(backgroundColor: Colors.black),
|
||||
dialogTheme: const DialogTheme(backgroundColor: Colors.black),
|
||||
bottomSheetTheme:
|
||||
const BottomSheetThemeData(backgroundColor: Colors.black),
|
||||
listTileTheme: const ListTileThemeData(tileColor: Colors.black12),
|
||||
cardTheme: const CardTheme(color: Colors.black12),
|
||||
navigationBarTheme:
|
||||
const NavigationBarThemeData(backgroundColor: Colors.black),
|
||||
popupMenuTheme: const PopupMenuThemeData(color: Colors.black),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user