mirror of
https://github.com/immich-app/immich.git
synced 2024-12-17 12:22:31 +02:00
d02b97e1c1
* 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
22 lines
458 B
Dart
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);
|
|
}
|
|
}
|