import 'package:immich_mobile/constants/immich_colors.dart'; import 'package:immich_mobile/entities/store.entity.dart'; enum AppSettingsEnum { loadPreview(StoreKey.loadPreview, "loadPreview", true), loadOriginal(StoreKey.loadOriginal, "loadOriginal", false), themeMode( StoreKey.themeMode, "themeMode", "system", ), // "light","dark","system" primaryColor( StoreKey.primaryColor, "primaryColor", defaultColorPresetName, ), dynamicTheme( StoreKey.dynamicTheme, "dynamicTheme", false, ), colorfulInterface( StoreKey.colorfulInterface, "colorfulInterface", true, ), 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), loopVideo(StoreKey.loopVideo, "loopVideo", true), mapThemeMode(StoreKey.mapThemeMode, null, 0), mapShowFavoriteOnly(StoreKey.mapShowFavoriteOnly, null, false), mapIncludeArchived(StoreKey.mapIncludeArchived, null, false), mapwithPartners(StoreKey.mapwithPartners, null, false), mapRelativeDate(StoreKey.mapRelativeDate, null, 0), allowSelfSignedSSLCert(StoreKey.selfSignedCert, null, false), ignoreIcloudAssets(StoreKey.ignoreIcloudAssets, null, false), selectedAlbumSortReverse( StoreKey.selectedAlbumSortReverse, null, false, ), enableHapticFeedback(StoreKey.enableHapticFeedback, null, true), ; 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); } }