1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-17 12:22:31 +02:00
immich/mobile/lib/shared/services/local_storage.service.dart
xpwmaosldk d02b97e1c1
Add service provider (#250)
* optimize android side gradle settings

* android minsdk back to 21

* remove unused package, update linter and fix lint error

* clean code of 'shared module' with offical dart style guide

* restore uploadProfileImage method in UserService

* add service provider

* fix searchFocusNode init error
2022-06-25 13:46:51 -05:00

22 lines
458 B
Dart

import 'package:hive/hive.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/constants/hive_box.dart';
final localStorageServiceProvider = Provider((_) => LocalStorageService());
class LocalStorageService {
late Box _box;
LocalStorageService() {
_box = Hive.box(userInfoBox);
}
T get<T>(String key) {
return _box.get(key);
}
put<T>(String key, T value) {
return _box.put(key, value);
}
}