TF-3759 Update style popup context menu for email more action on thread view

Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
dab246
2025-06-13 13:44:12 +07:00
committed by Dat H. Pham
parent 0a7ec53885
commit 5fe264c670
8 changed files with 173 additions and 139 deletions
@@ -0,0 +1,38 @@
import 'package:core/presentation/extensions/color_extension.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
typedef OnPopupMenuActionClick = void Function(PopupMenuItemAction action);
abstract class PopupMenuItemAction<T> with EquatableMixin {
final T action;
PopupMenuItemAction(this.action);
@override
List<Object?> get props => [action];
String get actionName;
String getActionNameWithLimitation({int limitCharacters = 22}) =>
actionName.length > limitCharacters
? '${actionName.substring(0, limitCharacters)}...'
: actionName;
Color get actionNameColor => Colors.black;
void onClick(OnPopupMenuActionClick callback) => callback(this);
}
mixin OptionalPopupIcon {
String get actionIcon;
Color get actionIconColor => AppColor.steelGrayA540;
double get actionIconSize => 20.0;
}
abstract class PopupMenuItemActionRequiredIcon<T>
extends PopupMenuItemAction<T> with OptionalPopupIcon {
PopupMenuItemActionRequiredIcon(super.action);
}