part of store;

class ConfigStore extends GetxController {
  static ConfigStore get to => Get.find();

  @override
  void onInit() {
    super.onInit();
    _initThemeMode();
  }

  /// 主题模式
  void _initThemeMode() {
    final theme = StorageService.to.getString(C.localThemeMode);
    switch (theme) {
      case C.themeLight:
        AppTheme.mode = ThemeMode.light;
        break;
      case C.themeDark:
        AppTheme.mode = ThemeMode.dark;
        break;
      default:
        AppTheme.mode = ThemeMode.system;
        break;
    }
    AppTheme.setSystemStyle();
  }
}
