2025-06-30 12:21:09 -05:00
|
|
|
import 'package:immich_mobile/services/action.service.dart';
|
|
|
|
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
|
|
|
|
|
|
|
|
|
final actionProvider = NotifierProvider<ActionNotifier, void>(
|
|
|
|
|
ActionNotifier.new,
|
|
|
|
|
dependencies: [
|
|
|
|
|
actionServiceProvider,
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
class ActionNotifier extends Notifier<void> {
|
|
|
|
|
late final ActionService _service;
|
|
|
|
|
|
|
|
|
|
ActionNotifier() : super();
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void build() {
|
|
|
|
|
_service = ref.watch(actionServiceProvider);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> favorite(List<String> ids) async {
|
|
|
|
|
await _service.favorite(ids);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> unFavorite(List<String> ids) async {
|
|
|
|
|
await _service.unFavorite(ids);
|
|
|
|
|
}
|
2025-07-01 03:38:15 +08:00
|
|
|
|
|
|
|
|
Future<void> archive(List<String> ids) async {
|
|
|
|
|
await _service.archive(ids);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> unArchive(List<String> ids) async {
|
|
|
|
|
await _service.unArchive(ids);
|
|
|
|
|
}
|
2025-06-30 12:21:09 -05:00
|
|
|
}
|