From 06285a02ff4600ce47b92929460ba46691b88b91 Mon Sep 17 00:00:00 2001 From: Eric Poulsen Date: Sat, 13 Jun 2026 16:36:55 -0700 Subject: [PATCH] onSecondaryTap for map_screen --- lib/screens/map_screen.dart | 48 +++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/lib/screens/map_screen.dart b/lib/screens/map_screen.dart index 3f57dfac..36b536e1 100644 --- a/lib/screens/map_screen.dart +++ b/lib/screens/map_screen.dart @@ -285,6 +285,27 @@ class _MapScreenState extends State { ); } + void _handleMapTap(BuildContext context, MeshCoreConnector connector, LatLng latLng) { + if (_isSelectingPoi) { + setState(() { + _isSelectingPoi = false; + }); + _shareMarker( + context: context, + connector: connector, + position: latLng, + defaultLabel: context.l10n.map_pointOfInterest, + flags: 'poi', + ); + return; + } + _showShareMarkerAtPositionSheet( + context: context, + connector: connector, + position: latLng, + ); + } + @override Widget build(BuildContext context) { return Builder( @@ -708,24 +729,10 @@ class _MapScreenState extends State { } }, onLongPress: (_, latLng) { - if (_isSelectingPoi) { - setState(() { - _isSelectingPoi = false; - }); - _shareMarker( - context: context, - connector: connector, - position: latLng, - defaultLabel: context.l10n.map_pointOfInterest, - flags: 'poi', - ); - return; - } - _showShareMarkerAtPositionSheet( - context: context, - connector: connector, - position: latLng, - ); + _handleMapTap(context, connector, latLng); + }, + onSecondaryTap: (_, latLng) { + _handleMapTap(context, connector, latLng); }, onPositionChanged: (camera, hasGesture) { // Track zoom in half-step buckets so cluster/marker @@ -1184,6 +1191,9 @@ class _MapScreenState extends State { onLongPress: () => _isBuildingPathTrace ? _showNodeInfo(context, guess.contact) : null, + onSecondaryTap: () => _isBuildingPathTrace + ? _showNodeInfo(context, guess.contact) + : null, onTap: () => _isBuildingPathTrace ? _addToPath(context, guess.contact, position: guess.position) : _selectNode(guess.contact, guessedPosition: guess.position), @@ -1385,6 +1395,8 @@ class _MapScreenState extends State { behavior: HitTestBehavior.opaque, onLongPress: () => _isBuildingPathTrace ? _showNodeInfo(context, contact) : null, + onSecondaryTap: () => + _isBuildingPathTrace ? _showNodeInfo(context, contact) : null, onTap: () => _isBuildingPathTrace ? _addToPath(context, contact) : _selectNode(contact),