import 'package:immich_mobile/shared/models/store.dart'; enum AppSettingsEnum { loadPreview(StoreKey.loadPreview, "loadPreview", true), loadOriginal(StoreKey.loadOriginal, "loadOriginal", false), themeMode( StoreKey.themeMode, "themeMode", "system", ), // "light","dark","system" tilesPerRow(StoreKey.tilesPerRow, "tilesPerRow", 4), dynamicLayout(StoreKey.dynamicLayout, "dynamicLayout", false), groupAssetsBy(StoreKey.groupAssetsBy, "groupBy", 0), uploadErrorNotificationGracePeriod( StoreKey.uploadErrorNotificationGracePeriod, "uploadErrorNotificationGracePeriod", 2, ), backgroundBackupTotalProgress( StoreKey.backgroundBackupTotalProgress, "backgroundBackupTotalProgress", true, ), backgroundBackupSingleProgress( StoreKey.backgroundBackupSingleProgress, "backgroundBackupSingleProgress", false, ), storageIndicator(StoreKey.storageIndicator, "storageIndicator", true), thumbnailCacheSize( StoreKey.thumbnailCacheSize, "thumbnailCacheSize", 10000, ), imageCacheSize(StoreKey.imageCacheSize, "imageCacheSize", 350), albumThumbnailCacheSize( StoreKey.albumThumbnailCacheSize, "albumThumbnailCacheSize", 200, ), selectedAlbumSortOrder( StoreKey.selectedAlbumSortOrder, "selectedAlbumSortOrder", 0, ), advancedTroubleshooting(StoreKey.advancedTroubleshooting, null, false), logLevel(StoreKey.logLevel, null, 5), // Level.INFO = 5 preferRemoteImage(StoreKey.preferRemoteImage, null, false), ; const AppSettingsEnum(this.storeKey, this.hiveKey, this.defaultValue); final StoreKey storeKey; final String? hiveKey; final T defaultValue; } class AppSettingsService { T getSetting(AppSettingsEnum setting) { return Store.get(setting.storeKey, setting.defaultValue); } void setSetting(AppSettingsEnum setting, T value) { Store.put(setting.storeKey, value); } }