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
This commit is contained in:
xpwmaosldk 2022-06-26 03:46:51 +09:00 committed by GitHub
parent 485b152beb
commit d02b97e1c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 288 additions and 157 deletions

View file

@ -9,11 +9,10 @@ import 'package:intl/intl.dart';
import 'package:photo_manager/photo_manager.dart';
class AssetNotifier extends StateNotifier<List<ImmichAsset>> {
final AssetService _assetService = AssetService();
final AssetService _assetService;
final DeviceInfoService _deviceInfoService = DeviceInfoService();
final Ref ref;
AssetNotifier(this.ref) : super([]);
AssetNotifier(this._assetService) : super([]);
getAllAsset() async {
List<ImmichAsset>? allAssets = await _assetService.getAllAsset();
@ -71,7 +70,7 @@ class AssetNotifier extends StateNotifier<List<ImmichAsset>> {
final assetProvider =
StateNotifierProvider<AssetNotifier, List<ImmichAsset>>((ref) {
return AssetNotifier(ref);
return AssetNotifier(ref.watch(assetServiceProvider));
});
final assetGroupByDateTimeProvider = StateProvider((ref) {