From 850905aa4e515fbaaf1a8e979ad5935835ee6b12 Mon Sep 17 00:00:00 2001 From: dab246 Date: Wed, 21 Aug 2024 16:12:58 +0700 Subject: [PATCH] fixup! Fix cannot click item app grid --- .../app_grid_dashboard_icon.dart | 60 +++++++++---------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/lib/features/mailbox_dashboard/presentation/widgets/app_dashboard/app_grid_dashboard_icon.dart b/lib/features/mailbox_dashboard/presentation/widgets/app_dashboard/app_grid_dashboard_icon.dart index a5577f8c3d..504b17f1bf 100644 --- a/lib/features/mailbox_dashboard/presentation/widgets/app_dashboard/app_grid_dashboard_icon.dart +++ b/lib/features/mailbox_dashboard/presentation/widgets/app_dashboard/app_grid_dashboard_icon.dart @@ -24,40 +24,38 @@ class AppGridDashboardIcon extends StatelessWidget { Widget build(BuildContext context) { return Obx(() { final isAppGridOpen = appGridController.isAppGridDashboardOverlayOpen.value; - return Semantics( - excludeSemantics: true, + return PortalTarget( + visible: isAppGridOpen, + portalFollower: GestureDetector( + behavior: HitTestBehavior.opaque, + excludeFromSemantics: true, + onTap: appGridController.toggleAppGridDashboard + ), child: PortalTarget( + anchor: Aligned( + follower: AppUtils.isDirectionRTL(context) + ? Alignment.topLeft + : Alignment.topRight, + target: AppUtils.isDirectionRTL(context) + ? Alignment.bottomLeft + : Alignment.bottomRight + ), + portalFollower: Obx(() { + final listApps = appGridController.linagoraApplications.value; + if (listApps?.apps.isNotEmpty == true) { + return AppDashboardOverlay(listApps!); + } + return const SizedBox.shrink(); + }), visible: isAppGridOpen, - portalFollower: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: appGridController.toggleAppGridDashboard + child: TMailButtonWidget.fromIcon( + icon: _imagePaths.icAppDashboard, + backgroundColor: Colors.transparent, + iconSize: 30, + padding: const EdgeInsets.all(6), + onTapActionCallback: onShowAppDashboardAction, ), - child: PortalTarget( - anchor: Aligned( - follower: AppUtils.isDirectionRTL(context) - ? Alignment.topLeft - : Alignment.topRight, - target: AppUtils.isDirectionRTL(context) - ? Alignment.bottomLeft - : Alignment.bottomRight - ), - portalFollower: Obx(() { - final listApps = appGridController.linagoraApplications.value; - if (listApps?.apps.isNotEmpty == true) { - return AppDashboardOverlay(listApps!); - } - return const SizedBox.shrink(); - }), - visible: isAppGridOpen, - child: TMailButtonWidget.fromIcon( - icon: _imagePaths.icAppDashboard, - backgroundColor: Colors.transparent, - iconSize: 30, - padding: const EdgeInsets.all(6), - onTapActionCallback: onShowAppDashboardAction, - ), - ) - ), + ) ); }); }