mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
32 lines
570 B
Dart
32 lines
570 B
Dart
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||
|
|
|
||
|
|
class ViewIntentFilePathNotifier extends Notifier<String?> {
|
||
|
|
@override
|
||
|
|
String? build() => null;
|
||
|
|
|
||
|
|
void setPath(String path) {
|
||
|
|
if (state == path) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
state = path;
|
||
|
|
}
|
||
|
|
|
||
|
|
void clear() {
|
||
|
|
if (state == null) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
state = null;
|
||
|
|
}
|
||
|
|
|
||
|
|
void clearIfMatch(String path) {
|
||
|
|
if (state != path) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
state = null;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
final viewIntentFilePathProvider = NotifierProvider<ViewIntentFilePathNotifier, String?>(
|
||
|
|
ViewIntentFilePathNotifier.new,
|
||
|
|
);
|