Skip to content

Commit

Permalink
Fix cannot click item in popup menu
Browse files Browse the repository at this point in the history
  • Loading branch information
dab246 committed Aug 14, 2024
1 parent 2b96f45 commit 5c95fb9
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 32 deletions.
67 changes: 35 additions & 32 deletions lib/features/base/widget/popup_item_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,38 +33,41 @@ class PopupItemWidget extends StatelessWidget {

@override
Widget build(BuildContext context) {
return PointerInterceptor(
child: InkWell(
onTap: onCallbackAction,
child: Container(
height: PopupItemWidgetStyle.height,
constraints: const BoxConstraints(minWidth: PopupItemWidgetStyle.minWidth),
padding: padding,
child: Row(children: [
SvgPicture.asset(
_iconAction,
width: iconSize ?? PopupItemWidgetStyle.iconSize,
height: iconSize ?? PopupItemWidgetStyle.iconSize,
fit: BoxFit.fill,
colorFilter: colorIcon?.asFilter()
),
const SizedBox(width: PopupItemWidgetStyle.space),
Expanded(child: Text(
_nameAction,
style: styleName ?? PopupItemWidgetStyle.labelTextStyle
)),
if (isSelected == true && selectedIcon != null)
Padding(
padding: PopupItemWidgetStyle.iconSelectedPadding,
child: SvgPicture.asset(
selectedIcon!,
width: PopupItemWidgetStyle.selectedIconSize,
height: PopupItemWidgetStyle.selectedIconSize,
fit: BoxFit.fill
),
)
]),
)
return Semantics(
excludeSemantics: true,
child: PointerInterceptor(
child: InkWell(
onTap: onCallbackAction,
child: Container(
height: PopupItemWidgetStyle.height,
constraints: const BoxConstraints(minWidth: PopupItemWidgetStyle.minWidth),
padding: padding,
child: Row(children: [
SvgPicture.asset(
_iconAction,
width: iconSize ?? PopupItemWidgetStyle.iconSize,
height: iconSize ?? PopupItemWidgetStyle.iconSize,
fit: BoxFit.fill,
colorFilter: colorIcon?.asFilter()
),
const SizedBox(width: PopupItemWidgetStyle.space),
Expanded(child: Text(
_nameAction,
style: styleName ?? PopupItemWidgetStyle.labelTextStyle
)),
if (isSelected == true && selectedIcon != null)
Padding(
padding: PopupItemWidgetStyle.iconSelectedPadding,
child: SvgPicture.asset(
selectedIcon!,
width: PopupItemWidgetStyle.selectedIconSize,
height: PopupItemWidgetStyle.selectedIconSize,
fit: BoxFit.fill
),
)
]),
)
),
),
);
}
Expand Down
3 changes: 3 additions & 0 deletions lib/features/composer/presentation/composer_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ class ComposerView extends GetWidget<ComposerController> {
List<PopupMenuEntry> _createMoreOptionPopupItems(BuildContext context) {
return [
PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: PopupItemWidget(
controller.imagePaths.icReadReceipt,
Expand All @@ -440,6 +441,7 @@ class ComposerView extends GetWidget<ComposerController> {
)
),
PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: PopupItemWidget(
controller.imagePaths.icSaveToDraft,
Expand All @@ -454,6 +456,7 @@ class ComposerView extends GetWidget<ComposerController> {
)
),
PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: PopupItemWidget(
controller.imagePaths.icDeleteMailbox,
Expand Down
4 changes: 4 additions & 0 deletions lib/features/composer/presentation/composer_view_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@ class ComposerView extends GetWidget<ComposerController> {
List<PopupMenuEntry> _createMoreOptionPopupItems(BuildContext context) {
return [
PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: PopupItemWidget(
controller.imagePaths.icStyleCodeView,
Expand All @@ -812,6 +813,7 @@ class ComposerView extends GetWidget<ComposerController> {
)
),
PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: PopupItemWidget(
controller.imagePaths.icReadReceipt,
Expand All @@ -828,6 +830,7 @@ class ComposerView extends GetWidget<ComposerController> {
)
),
PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: PopupItemWidget(
controller.imagePaths.icSaveToDraft,
Expand All @@ -842,6 +845,7 @@ class ComposerView extends GetWidget<ComposerController> {
)
),
PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: PopupItemWidget(
controller.imagePaths.icDeleteMailbox,
Expand Down
1 change: 1 addition & 0 deletions lib/features/email/presentation/email_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ class EmailView extends GetWidget<SingleEmailController> {
) {
return actionTypes.map((action) {
return PopupMenuItem(
enabled: false,
key: Key('${action.name}_action'),
padding: EdgeInsets.zero,
child: PopupItemWidget(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ mixin MailboxWidgetMixin {
}
) {
return PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: AbsorbPointer(
absorbing: !contextMenuItem.isActivated,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView {
) {
return EmailReceiveTimeType.values
.map((receiveTime) => PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: PopupItemNoIconWidget(
receiveTime.getTitle(context),
Expand All @@ -607,6 +608,7 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView {
) {
return EmailSortOrderType.values
.map((sortType) => PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: PopupItemNoIconWidget(
sortType.getTitle(context),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ mixin FilterEmailPopupMenuMixin {
if (!isSearchEmailRunning)
...[
PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: _filterEmailAction(
context,
Expand All @@ -30,6 +31,7 @@ mixin FilterEmailPopupMenuMixin {
const PopupMenuDivider(height: 0.5)
],
PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: _filterEmailAction(
context,
Expand All @@ -38,6 +40,7 @@ mixin FilterEmailPopupMenuMixin {
onCallBack)),
const PopupMenuDivider(height: 0.5),
PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: _filterEmailAction(
context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ mixin UserSettingPopupMenuMixin {
...[
const PopupMenuDivider(height: 0.5),
PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: _settingAction(context, onSettingAction)
),
Expand All @@ -52,6 +53,7 @@ mixin UserSettingPopupMenuMixin {
...[
const PopupMenuDivider(height: 0.5),
PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: _logoutAction(context, onLogoutAction)
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class AdvancedSearchInputForm extends GetWidget<AdvancedFilterController>
List<Widget> _buildEmailReceiveTimeTypeActionTiles(BuildContext context) {
return EmailReceiveTimeType.values
.map((receiveTime) => PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: PopupItemNoIconWidget(
receiveTime.getTitle(context),
Expand Down
3 changes: 3 additions & 0 deletions lib/features/search/email/presentation/search_email_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ class SearchEmailView extends GetWidget<SearchEmailController>
) {
return EmailReceiveTimeType.values
.map((timeType) => PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: EmailReceiveTimeActionTileWidget(
receiveTimeSelected: receiveTimeSelected,
Expand Down Expand Up @@ -329,6 +330,7 @@ class SearchEmailView extends GetWidget<SearchEmailController>
) {
return EmailSortOrderType.values
.map((sortType) => PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: EmailSortByActionTitleWidget(
sortType: sortType,
Expand Down Expand Up @@ -639,6 +641,7 @@ class SearchEmailView extends GetWidget<SearchEmailController>
List<PopupMenuEntry> _popupMenuActionTile(BuildContext context, PresentationEmail email) {
return [
PopupMenuItem(
enabled: false,
padding: const EdgeInsets.symmetric(horizontal: 8),
child: _markAsEmailSpamOrUnSpamAction(context, email)),
];
Expand Down
3 changes: 3 additions & 0 deletions lib/features/thread/presentation/thread_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,7 @@ class ThreadView extends GetWidget<ThreadController>
PresentationMailbox? mailboxContain
) {
return PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: popupItem(
mailboxContain?.isSpam == true ? controller.imagePaths.icNotSpam : controller.imagePaths.icSpam,
Expand Down Expand Up @@ -832,6 +833,7 @@ class ThreadView extends GetWidget<ThreadController>
PresentationMailbox? mailboxContain
) {
return PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: popupItem(
controller.imagePaths.icOpenInNewTab,
Expand All @@ -855,6 +857,7 @@ class ThreadView extends GetWidget<ThreadController>
PresentationEmail email
) {
return PopupMenuItem(
enabled: false,
padding: EdgeInsets.zero,
child: popupItem(
controller.imagePaths.icMailboxArchived,
Expand Down

0 comments on commit 5c95fb9

Please sign in to comment.