import 'package:immich_mobile/entities/user.entity.dart'; /// Key for each possible value in the `Store`. /// Defines the data type for each value enum StoreKey { version._(0), assetETag._(1), currentUser._(2), deviceIdHash._(3), deviceId._(4), backupFailedSince._(5), backupRequireWifi._(6), backupRequireCharging._(7), backupTriggerDelay._(8), serverUrl._(10), accessToken._(11), serverEndpoint._(12), autoBackup._(13), backgroundBackup._(14), sslClientCertData._(15), sslClientPasswd._(16), // user settings from [AppSettingsEnum] below: loadPreview._(100), loadOriginal._(101), themeMode._(102), tilesPerRow._(103), dynamicLayout._(104), groupAssetsBy._(105), uploadErrorNotificationGracePeriod._(106), backgroundBackupTotalProgress._(107), backgroundBackupSingleProgress._(108), storageIndicator._(109), thumbnailCacheSize._(110), imageCacheSize._(111), albumThumbnailCacheSize._(112), selectedAlbumSortOrder._(113), advancedTroubleshooting._(114), logLevel._(115), preferRemoteImage._(116), loopVideo._(117), // map related settings mapShowFavoriteOnly._(118), mapRelativeDate._(119), selfSignedCert._(120), mapIncludeArchived._(121), ignoreIcloudAssets._(122), selectedAlbumSortReverse._(123), mapThemeMode._(124), mapwithPartners._(125), enableHapticFeedback._(126), customHeaders._(127), // theme settings primaryColor._(128), dynamicTheme._(129), colorfulInterface._(130), syncAlbums._(131), // Auto endpoint switching autoEndpointSwitching._(132), preferredWifiName._(133), localEndpoint._(134), externalEndpointList._(135), // Video settings loadOriginalVideo._(136), ; const StoreKey._(this.id); final int id; Type get type => T; } class StoreUpdateEvent { final StoreKey key; final T? value; const StoreUpdateEvent(this.key, this.value); @override String toString() { return ''' StoreUpdateEvent: { key: $key, value: ${value ?? ''}, }'''; } @override bool operator ==(covariant StoreUpdateEvent other) { if (identical(this, other)) return true; return other.key == key && other.value == value; } @override int get hashCode => key.hashCode ^ value.hashCode; }