mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(mobile): action provider (#19669)
* refactor action provider * fix lint
This commit is contained in:
parent
fa418d778b
commit
f59b0bab5a
7 changed files with 55 additions and 47 deletions
|
|
@ -1,7 +1,10 @@
|
|||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:immich_mobile/constants/enums.dart';
|
||||
import 'package:immich_mobile/domain/models/asset/base_asset.model.dart';
|
||||
import 'package:immich_mobile/infrastructure/repositories/remote_asset.repository.dart';
|
||||
import 'package:immich_mobile/repositories/asset_api.repository.dart';
|
||||
import 'package:immich_mobile/routing/router.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
final actionServiceProvider = Provider<ActionService>(
|
||||
|
|
@ -17,6 +20,14 @@ class ActionService {
|
|||
|
||||
const ActionService(this._assetApiRepository, this._remoteAssetRepository);
|
||||
|
||||
Future<void> shareLink(List<String> remoteIds, BuildContext context) async {
|
||||
context.pushRoute(
|
||||
SharedLinkEditRoute(
|
||||
assetsList: remoteIds,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> favorite(List<String> remoteIds) async {
|
||||
await _assetApiRepository.updateFavorite(remoteIds, true);
|
||||
await _remoteAssetRepository.updateFavorite(remoteIds, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue