mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
29 lines
645 B
Dart
29 lines
645 B
Dart
|
|
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);
|
||
|
|
}
|
||
|
|
}
|