diff --git a/lib/pages/mine/controller.dart b/lib/pages/mine/controller.dart index 19930930e..7f1721ff2 100644 --- a/lib/pages/mine/controller.dart +++ b/lib/pages/mine/controller.dart @@ -30,12 +30,14 @@ class MineController // 用户状态 动态、关注、粉丝 Rx userStat = UserStat().obs; - Rx themeType = ThemeType.system.obs; - static RxBool anonymity = - (Accounts.account.isNotEmpty && !Accounts.heartbeat.isLogin).obs; + Rx themeType = Pref.themeType.obs; + ThemeType get nextThemeType => ThemeType.values[(themeType.value.index + 1) % ThemeType.values.length]; + static RxBool anonymity = + (Accounts.account.isNotEmpty && !Accounts.heartbeat.isLogin).obs; + late final list = <({IconData icon, double size, String title, VoidCallback onTap})>[ ( diff --git a/lib/utils/storage_pref.dart b/lib/utils/storage_pref.dart index 44ce45bde..32bf07b12 100644 --- a/lib/utils/storage_pref.dart +++ b/lib/utils/storage_pref.dart @@ -79,13 +79,13 @@ abstract class Pref { defaultValue: 0, )]; - static int get themeTypeInt => _setting.get( + static int get _themeTypeInt => _setting.get( SettingBoxKey.themeMode, defaultValue: ThemeType.system.index, ); static ThemeMode get themeMode { - return switch (themeTypeInt) { + return switch (_themeTypeInt) { 0 => ThemeMode.light, 1 => ThemeMode.dark, _ => ThemeMode.system, @@ -142,7 +142,7 @@ abstract class Pref { static int get picQuality => _setting.get(SettingBoxKey.defaultPicQa, defaultValue: 10); - static ThemeType get themeType => ThemeType.values[themeTypeInt]; + static ThemeType get themeType => ThemeType.values[_themeTypeInt]; static DynamicBadgeMode get dynamicBadgeType => DynamicBadgeMode.values[_setting.get(