diff --git a/lib/helpers/link_handler.dart b/lib/helpers/link_handler.dart index b1c97855..980369da 100644 --- a/lib/helpers/link_handler.dart +++ b/lib/helpers/link_handler.dart @@ -1,3 +1,4 @@ +import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_linkify/flutter_linkify.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -39,7 +40,7 @@ class LinkHandler { if (onSecondaryTap == null) return linkify; return Listener( onPointerDown: (event) { - if (event.buttons == 2) onSecondaryTap(); + if (event.buttons & kSecondaryMouseButton != 0) onSecondaryTap(); }, behavior: HitTestBehavior.translucent, child: linkify, diff --git a/lib/widgets/routing_sheet.dart b/lib/widgets/routing_sheet.dart index cc3bc783..6d87a0df 100644 --- a/lib/widgets/routing_sheet.dart +++ b/lib/widgets/routing_sheet.dart @@ -1,4 +1,5 @@ import 'package:flutter/foundation.dart'; +import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -538,7 +539,7 @@ class _RoutingSheetBodyState extends State<_RoutingSheetBody> { return Listener( onPointerDown: PlatformInfo.isDesktop && hasBytes ? (event) { - if (event.buttons == 2) { + if (event.buttons & kSecondaryMouseButton != 0) { _showPathDetail(context, connector, contact, record.pathBytes); } }