mirror of
https://github.com/immich-app/immich.git
synced 2026-07-04 03:45:59 -07:00
cb1af3a8ec
* chore: cleanup partner action test * feat: favorite bottom sheet action * review suggestions * implicit favorite handling * feat: viewer favorite icon to action (#29321) * feat: viewer favorite icon to action * feat: advance info action * implicit favorite handling * feat: viewer favorite icon to action # Conflicts: # mobile/lib/presentation/widgets/asset_viewer/viewer_top_app_bar.widget.dart --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> * chore: timeline action test (#29324) Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> * clear selection only on success --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
33 lines
844 B
Dart
33 lines
844 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:immich_mobile/domain/models/asset/base_asset.model.dart';
|
|
import 'package:immich_mobile/domain/models/user.model.dart';
|
|
|
|
class ActionScope {
|
|
final BuildContext context;
|
|
final WidgetRef ref;
|
|
final UserDto authUser;
|
|
|
|
const ActionScope({required this.context, required this.ref, required this.authUser});
|
|
}
|
|
|
|
abstract class BaseAction {
|
|
const BaseAction();
|
|
|
|
IconData get icon;
|
|
|
|
String label(ActionScope scope);
|
|
|
|
bool isVisible(ActionScope scope) => true;
|
|
|
|
Future<void> onAction(ActionScope scope);
|
|
}
|
|
|
|
abstract class AssetAction<T extends BaseAsset> extends BaseAction {
|
|
final Iterable<BaseAsset> assets;
|
|
|
|
const AssetAction({required this.assets});
|
|
|
|
Iterable<T> filter(ActionScope scope) => assets.whereType<T>();
|
|
}
|