refactor: clean up

This commit is contained in:
idubnori
2025-12-10 01:28:31 +09:00
parent 7473b959dc
commit 17361d189c
8 changed files with 38 additions and 86 deletions

View File

@@ -169,22 +169,22 @@ enum ActionButtonType {
}
}
/// Builder class for creating action button widgets.
/// This class provides simple factory methods for building action button widgets
/// from ActionButtonContext. Business logic for quick actions is handled by QuickActionService.
class ActionButtonBuilder {
static const List<ActionButtonType> _actionTypes = ActionButtonType.values;
/// Build a list of quick action widgets based on context and custom order.
/// Uses QuickActionService for business logic.
static List<Widget> buildQuickActions(
ActionButtonContext context, {
required List<ActionButtonType> quickActionTypes,
}) {
return quickActionTypes.map((type) => type.buildButton(context)).toList();
}
static const int defaultQuickActionLimit = 4;
static const List<ActionButtonType> defaultQuickActionOrder = [
ActionButtonType.share,
ActionButtonType.upload,
ActionButtonType.edit,
ActionButtonType.add,
ActionButtonType.archive,
ActionButtonType.delete,
ActionButtonType.removeFromAlbum,
ActionButtonType.likeActivity,
];
/// Build all available action button widgets for the given context.
static List<Widget> build(ActionButtonContext context) {
return _actionTypes.where((type) => type.shouldShow(context)).map((type) => type.buildButton(context)).toList();
}