chore: style grid

This commit is contained in:
shenlong-tanwen
2024-09-13 04:00:50 +05:30
parent 419d3669a2
commit 53974e7276
23 changed files with 344 additions and 127 deletions
@@ -2,21 +2,21 @@ import 'package:immich_mobile/domain/interfaces/store.interface.dart';
import 'package:immich_mobile/domain/models/app_setting.model.dart';
class AppSettingService {
final IStoreRepository store;
final IStoreRepository _store;
const AppSettingService(this.store);
const AppSettingService(this._store);
Future<T> getSetting<T>(AppSetting<T> setting) async {
final value = await store.tryGet(setting.storeKey);
final value = await _store.tryGet(setting.storeKey);
return value ?? setting.defaultValue;
}
Future<bool> setSetting<T>(AppSetting<T> setting, T value) async {
return await store.set(setting.storeKey, value);
return await _store.set(setting.storeKey, value);
}
Stream<T> watchSetting<T>(AppSetting<T> setting) {
return store
return _store
.watch(setting.storeKey)
.map((value) => value ?? setting.defaultValue);
}