mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-06-21 01:45:47 +10:00
Use kSecondaryMouseButton bitmask check, per code review
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_linkify/flutter_linkify.dart';
|
import 'package:flutter_linkify/flutter_linkify.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
@@ -39,7 +40,7 @@ class LinkHandler {
|
|||||||
if (onSecondaryTap == null) return linkify;
|
if (onSecondaryTap == null) return linkify;
|
||||||
return Listener(
|
return Listener(
|
||||||
onPointerDown: (event) {
|
onPointerDown: (event) {
|
||||||
if (event.buttons == 2) onSecondaryTap();
|
if (event.buttons & kSecondaryMouseButton != 0) onSecondaryTap();
|
||||||
},
|
},
|
||||||
behavior: HitTestBehavior.translucent,
|
behavior: HitTestBehavior.translucent,
|
||||||
child: linkify,
|
child: linkify,
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
@@ -538,7 +539,7 @@ class _RoutingSheetBodyState extends State<_RoutingSheetBody> {
|
|||||||
return Listener(
|
return Listener(
|
||||||
onPointerDown: PlatformInfo.isDesktop && hasBytes
|
onPointerDown: PlatformInfo.isDesktop && hasBytes
|
||||||
? (event) {
|
? (event) {
|
||||||
if (event.buttons == 2) {
|
if (event.buttons & kSecondaryMouseButton != 0) {
|
||||||
_showPathDetail(context, connector, contact, record.pathBytes);
|
_showPathDetail(context, connector, contact, record.pathBytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user