TF-3766 Remove container of icon in context menu
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -16,76 +16,63 @@ class ContextMenuDialogItem extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
SvgPicture? icon;
|
Widget? iconWidget;
|
||||||
SvgPicture? selectedIcon;
|
Widget? selectedIconWidget;
|
||||||
bool isSelected = false;
|
bool isSelected = false;
|
||||||
|
|
||||||
if (menuAction is ContextMenuItemActionRequiredIcon) {
|
if (menuAction is ContextMenuItemActionRequiredIcon) {
|
||||||
final specificMenuAction =
|
final specificMenuAction =
|
||||||
menuAction as ContextMenuItemActionRequiredIcon;
|
menuAction as ContextMenuItemActionRequiredIcon;
|
||||||
icon = SvgPicture.asset(
|
iconWidget = Padding(
|
||||||
specificMenuAction.actionIcon,
|
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||||
width: 20,
|
child: SvgPicture.asset(
|
||||||
height: 20,
|
specificMenuAction.actionIcon,
|
||||||
colorFilter: specificMenuAction.actionIconColor.asFilter(),
|
width: 20,
|
||||||
fit: BoxFit.fill,
|
height: 20,
|
||||||
|
colorFilter: specificMenuAction.actionIconColor.asFilter(),
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
} else if (menuAction is ContextMenuItemActionRequiredSelectedIcon) {
|
} else if (menuAction is ContextMenuItemActionRequiredSelectedIcon) {
|
||||||
final specificMenuAction =
|
final specificMenuAction =
|
||||||
menuAction as ContextMenuItemActionRequiredSelectedIcon;
|
menuAction as ContextMenuItemActionRequiredSelectedIcon;
|
||||||
selectedIcon = SvgPicture.asset(
|
selectedIconWidget = Padding(
|
||||||
specificMenuAction.selectedIcon,
|
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||||
width: 20,
|
child: SvgPicture.asset(
|
||||||
height: 20,
|
specificMenuAction.selectedIcon,
|
||||||
colorFilter: specificMenuAction.selectedIconColor.asFilter(),
|
width: 20,
|
||||||
fit: BoxFit.fill,
|
height: 20,
|
||||||
|
colorFilter: specificMenuAction.selectedIconColor.asFilter(),
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
isSelected = specificMenuAction.selectedAction == menuAction.action;
|
isSelected = specificMenuAction.selectedAction == menuAction.action;
|
||||||
} else if (menuAction is ContextMenuItemActionRequiredFull) {
|
} else if (menuAction is ContextMenuItemActionRequiredFull) {
|
||||||
final specificMenuAction =
|
final specificMenuAction =
|
||||||
menuAction as ContextMenuItemActionRequiredFull;
|
menuAction as ContextMenuItemActionRequiredFull;
|
||||||
|
iconWidget = Padding(
|
||||||
icon = SvgPicture.asset(
|
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||||
specificMenuAction.actionIcon,
|
child: SvgPicture.asset(
|
||||||
width: 20,
|
specificMenuAction.actionIcon,
|
||||||
height: 20,
|
width: 20,
|
||||||
colorFilter: specificMenuAction.actionIconColor.asFilter(),
|
height: 20,
|
||||||
fit: BoxFit.fill,
|
colorFilter: specificMenuAction.actionIconColor.asFilter(),
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
selectedIcon = SvgPicture.asset(
|
selectedIconWidget = Padding(
|
||||||
specificMenuAction.selectedIcon,
|
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||||
width: 20,
|
child: SvgPicture.asset(
|
||||||
height: 20,
|
specificMenuAction.selectedIcon,
|
||||||
colorFilter: specificMenuAction.selectedIconColor.asFilter(),
|
width: 20,
|
||||||
fit: BoxFit.fill,
|
height: 20,
|
||||||
|
colorFilter: specificMenuAction.selectedIconColor.asFilter(),
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
isSelected = specificMenuAction.selectedAction == menuAction.action;
|
isSelected = specificMenuAction.selectedAction == menuAction.action;
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget? iconWidget = icon != null
|
|
||||||
? Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
|
||||||
child: Container(
|
|
||||||
height: 32,
|
|
||||||
width: 32,
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child: icon,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: null;
|
|
||||||
|
|
||||||
Widget? selectedIconWidget = selectedIcon != null
|
|
||||||
? Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
|
||||||
child: Container(
|
|
||||||
height: 32,
|
|
||||||
width: 32,
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child: selectedIcon,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: null;
|
|
||||||
|
|
||||||
return Material(
|
return Material(
|
||||||
type: MaterialType.transparency,
|
type: MaterialType.transparency,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ extension FilterMessageOptionExtension on FilterMessageOption {
|
|||||||
case FilterMessageOption.attachments:
|
case FilterMessageOption.attachments:
|
||||||
return imagePaths.icAttachment;
|
return imagePaths.icAttachment;
|
||||||
case FilterMessageOption.starred:
|
case FilterMessageOption.starred:
|
||||||
return imagePaths.icStar;
|
return imagePaths.icUnStar;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user