replace bloc with watch_it

This commit is contained in:
shenlong-tanwen
2024-05-10 02:00:00 +05:30
parent aa5673bae3
commit fb6253d2d1
29 changed files with 663 additions and 239 deletions
@@ -0,0 +1,10 @@
import 'package:immich_mobile/domain/models/store.model.dart';
enum AppSettings<T> {
appTheme<int>(StoreKey.appTheme, 10);
const AppSettings(this.storeKey, this.defaultValue);
final StoreKey storeKey;
final T defaultValue;
}
+3 -6
View File
@@ -1,10 +1,7 @@
/// Key for each possible value in the `Store`.
/// Defines the data type for each value
enum StoreKey<T> {
// Server endpoint related stores
accessToken<String>(0, type: String),
serverEndpoint<String>(1, type: String),
;
enum StoreKey {
appTheme(1000, type: int);
const StoreKey(this.id, {required this.type});
final int id;
@@ -45,7 +42,7 @@ class StoreValue {
}
}
static StoreValue of<T>(StoreKey<T> key, T? value) {
static StoreValue of<T>(StoreKey key, T? value) {
int? i;
String? s;