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:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user