mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-27 22:16:37 +10:00
onSecondaryTap for map_screen
This commit is contained in:
+30
-18
@@ -285,6 +285,27 @@ class _MapScreenState extends State<MapScreen> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Builder(
|
return Builder(
|
||||||
@@ -708,24 +729,10 @@ class _MapScreenState extends State<MapScreen> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLongPress: (_, latLng) {
|
onLongPress: (_, latLng) {
|
||||||
if (_isSelectingPoi) {
|
_handleMapTap(context, connector, latLng);
|
||||||
setState(() {
|
},
|
||||||
_isSelectingPoi = false;
|
onSecondaryTap: (_, latLng) {
|
||||||
});
|
_handleMapTap(context, connector, latLng);
|
||||||
_shareMarker(
|
|
||||||
context: context,
|
|
||||||
connector: connector,
|
|
||||||
position: latLng,
|
|
||||||
defaultLabel: context.l10n.map_pointOfInterest,
|
|
||||||
flags: 'poi',
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_showShareMarkerAtPositionSheet(
|
|
||||||
context: context,
|
|
||||||
connector: connector,
|
|
||||||
position: latLng,
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
onPositionChanged: (camera, hasGesture) {
|
onPositionChanged: (camera, hasGesture) {
|
||||||
// Track zoom in half-step buckets so cluster/marker
|
// Track zoom in half-step buckets so cluster/marker
|
||||||
@@ -1184,6 +1191,9 @@ class _MapScreenState extends State<MapScreen> {
|
|||||||
onLongPress: () => _isBuildingPathTrace
|
onLongPress: () => _isBuildingPathTrace
|
||||||
? _showNodeInfo(context, guess.contact)
|
? _showNodeInfo(context, guess.contact)
|
||||||
: null,
|
: null,
|
||||||
|
onSecondaryTap: () => _isBuildingPathTrace
|
||||||
|
? _showNodeInfo(context, guess.contact)
|
||||||
|
: null,
|
||||||
onTap: () => _isBuildingPathTrace
|
onTap: () => _isBuildingPathTrace
|
||||||
? _addToPath(context, guess.contact, position: guess.position)
|
? _addToPath(context, guess.contact, position: guess.position)
|
||||||
: _selectNode(guess.contact, guessedPosition: guess.position),
|
: _selectNode(guess.contact, guessedPosition: guess.position),
|
||||||
@@ -1385,6 +1395,8 @@ class _MapScreenState extends State<MapScreen> {
|
|||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
onLongPress: () =>
|
onLongPress: () =>
|
||||||
_isBuildingPathTrace ? _showNodeInfo(context, contact) : null,
|
_isBuildingPathTrace ? _showNodeInfo(context, contact) : null,
|
||||||
|
onSecondaryTap: () =>
|
||||||
|
_isBuildingPathTrace ? _showNodeInfo(context, contact) : null,
|
||||||
onTap: () => _isBuildingPathTrace
|
onTap: () => _isBuildingPathTrace
|
||||||
? _addToPath(context, contact)
|
? _addToPath(context, contact)
|
||||||
: _selectNode(contact),
|
: _selectNode(contact),
|
||||||
|
|||||||
Reference in New Issue
Block a user