feat: revert exisitng buttons, adjust label name

This commit is contained in:
idubnori
2025-12-04 14:01:03 +09:00
parent 72f18183a1
commit c7c929b3b5
4 changed files with 36 additions and 58 deletions

View File

@@ -1,4 +1,4 @@
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:flutter/widgets.dart';
import 'package:immich_mobile/constants/enums.dart';
import 'package:immich_mobile/domain/models/album/album.model.dart';
import 'package:immich_mobile/domain/models/asset/base_asset.model.dart';
@@ -131,7 +131,7 @@ enum ActionButtonType {
};
}
ConsumerWidget buildButton(ActionButtonContext context) {
Widget buildButton(ActionButtonContext context) {
return switch (this) {
ActionButtonType.advancedInfo => AdvancedInfoActionButton(source: context.source),
ActionButtonType.share => ShareActionButton(source: context.source),
@@ -160,19 +160,7 @@ enum ActionButtonType {
class ActionButtonBuilder {
static const List<ActionButtonType> _actionTypes = ActionButtonType.values;
static const _excludedActions = {
ActionButtonType.share,
ActionButtonType.archive,
ActionButtonType.delete,
ActionButtonType.moveToLockFolder,
};
static final List<ActionButtonType> kebabMenuActionTypes = ActionButtonType.values
.where((type) => !_excludedActions.contains(type))
.toList();
static List<ConsumerWidget> build(ActionButtonContext context, {List<ActionButtonType>? actionTypes}) {
final types = actionTypes ?? _actionTypes;
return types.where((type) => type.shouldShow(context)).map((type) => type.buildButton(context)).toList();
static List<Widget> build(ActionButtonContext context) {
return _actionTypes.where((type) => type.shouldShow(context)).map((type) => type.buildButton(context)).toList();
}
}