Merge branch 'feature-pureBlackMode'
This commit is contained in:
@ -216,6 +216,21 @@ class BuildMainApp extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
Box setting = GStorage.setting;
|
||||||
|
|
||||||
|
/// 纯黑模式主题配置
|
||||||
|
ColorScheme? pureDarkColorScheme;
|
||||||
|
final bool enablePureBlack =
|
||||||
|
setting.get(SettingBoxKey.enablePureBlack, defaultValue: false);
|
||||||
|
if (enablePureBlack) {
|
||||||
|
pureDarkColorScheme = darkColorScheme.copyWith(
|
||||||
|
background: Colors.black,
|
||||||
|
surface: Colors.black,
|
||||||
|
onPrimary: Colors.black,
|
||||||
|
onSecondary: Colors.black,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
final SnackBarThemeData snackBarTheme = SnackBarThemeData(
|
final SnackBarThemeData snackBarTheme = SnackBarThemeData(
|
||||||
actionTextColor: lightColorScheme.primary,
|
actionTextColor: lightColorScheme.primary,
|
||||||
backgroundColor: lightColorScheme.secondaryContainer,
|
backgroundColor: lightColorScheme.secondaryContainer,
|
||||||
@ -255,13 +270,13 @@ class BuildMainApp extends StatelessWidget {
|
|||||||
title: 'PiliPala',
|
title: 'PiliPala',
|
||||||
theme: buildThemeData(
|
theme: buildThemeData(
|
||||||
currentThemeValue == ThemeType.dark
|
currentThemeValue == ThemeType.dark
|
||||||
? darkColorScheme
|
? pureDarkColorScheme ?? darkColorScheme
|
||||||
: lightColorScheme,
|
: lightColorScheme,
|
||||||
),
|
),
|
||||||
darkTheme: buildThemeData(
|
darkTheme: buildThemeData(
|
||||||
currentThemeValue == ThemeType.light
|
currentThemeValue == ThemeType.light
|
||||||
? lightColorScheme
|
? lightColorScheme
|
||||||
: darkColorScheme,
|
: pureDarkColorScheme ?? darkColorScheme,
|
||||||
),
|
),
|
||||||
localizationsDelegates: const [
|
localizationsDelegates: const [
|
||||||
GlobalCupertinoLocalizations.delegate,
|
GlobalCupertinoLocalizations.delegate,
|
||||||
|
|||||||
@ -249,6 +249,15 @@ class _StyleSettingState extends State<StyleSetting> {
|
|||||||
'当前模式:${settingController.themeType.value.description}',
|
'当前模式:${settingController.themeType.value.description}',
|
||||||
style: subTitleStyle)),
|
style: subTitleStyle)),
|
||||||
),
|
),
|
||||||
|
SetSwitchItem(
|
||||||
|
title: '纯黑模式',
|
||||||
|
subTitle: '深色模式时使用纯黑色背景,适用于OLED屏幕',
|
||||||
|
setKey: SettingBoxKey.enablePureBlack,
|
||||||
|
defaultVal: false,
|
||||||
|
callFn: (bool val) => {
|
||||||
|
if (val && Get.isDarkMode) {Get.appUpdate()}
|
||||||
|
},
|
||||||
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
dense: false,
|
dense: false,
|
||||||
onTap: () => settingController.setDynamicBadgeMode(context),
|
onTap: () => settingController.setDynamicBadgeMode(context),
|
||||||
|
|||||||
@ -137,7 +137,8 @@ class SettingBoxKey {
|
|||||||
enableGradientBg = 'enableGradientBg',
|
enableGradientBg = 'enableGradientBg',
|
||||||
enableDynamicSwitch = 'enableDynamicSwitch',
|
enableDynamicSwitch = 'enableDynamicSwitch',
|
||||||
navBarSort = 'navBarSort',
|
navBarSort = 'navBarSort',
|
||||||
actionTypeSort = 'actionTypeSort';
|
actionTypeSort = 'actionTypeSort',
|
||||||
|
enablePureBlack = 'enablePureBlack';
|
||||||
}
|
}
|
||||||
|
|
||||||
class LocalCacheKey {
|
class LocalCacheKey {
|
||||||
|
|||||||
Reference in New Issue
Block a user