fix(bugs):
fix(DeviceManagerScreen): show all devices when visibility=DELETED fix(MapScreen): cannot delete polylines when closing SnackBar on iOS
This commit is contained in:
@@ -117,12 +117,14 @@ class _MapScreenState extends State<MapScreen> with WidgetsBindingObserver {
|
||||
clusterManager.updateMap();
|
||||
},
|
||||
polylines: {
|
||||
Polyline(
|
||||
polylineId: const PolylineId('router'),
|
||||
points: polylinesSnapshot.data ?? [],
|
||||
color: Colors.deepPurpleAccent,
|
||||
width: 8,
|
||||
),
|
||||
if (polylinesSnapshot.data != null && polylinesSnapshot.data!.isNotEmpty) ... [
|
||||
Polyline(
|
||||
polylineId: const PolylineId('router'),
|
||||
points: polylinesSnapshot.data!,
|
||||
color: Colors.deepPurpleAccent,
|
||||
width: 8,
|
||||
),
|
||||
]
|
||||
},
|
||||
style: mapThemeSnapshot.data,
|
||||
);
|
||||
|
||||
@@ -72,7 +72,7 @@ onTapMarker(
|
||||
double.parse(device.settings!.latitude!),
|
||||
double.parse(device.settings!.longitude!),
|
||||
);
|
||||
mapBloc.findTheWay(
|
||||
await mapBloc.findTheWay(
|
||||
context,
|
||||
controller,
|
||||
myLocation,
|
||||
|
||||
@@ -16,13 +16,11 @@ showDirections(
|
||||
MapBloc mapBloc,
|
||||
String originalName,
|
||||
String destinationLocation,
|
||||
double devicelat,
|
||||
double devicelng,
|
||||
double deviceLat,
|
||||
double deviceLng,
|
||||
) {
|
||||
TextEditingController originController =
|
||||
TextEditingController(text: originalName);
|
||||
TextEditingController destinationController =
|
||||
TextEditingController(text: destinationLocation);
|
||||
TextEditingController originController = TextEditingController(text: originalName);
|
||||
TextEditingController destinationController = TextEditingController(text: destinationLocation);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
@@ -44,15 +42,14 @@ showDirections(
|
||||
alignment: Alignment.centerRight,
|
||||
child: IconButton.outlined(
|
||||
onPressed: () async {
|
||||
await mapBloc.updateCameraPosition(
|
||||
controller,
|
||||
devicelat,
|
||||
devicelng,
|
||||
13.0,
|
||||
);
|
||||
// List<LatLng> polylineCoordinates = [];
|
||||
mapBloc.sinkPolylines.add([]);
|
||||
markers.clear();
|
||||
await mapBloc.updateCameraPosition(
|
||||
controller,
|
||||
deviceLat,
|
||||
deviceLng,
|
||||
13.0,
|
||||
);
|
||||
if (context.mounted) {
|
||||
ScaffoldMessenger.of(context).hideCurrentSnackBar();
|
||||
}
|
||||
@@ -103,10 +100,9 @@ showDirections(
|
||||
ScaffoldMessenger.of(context).hideCurrentSnackBar();
|
||||
List<LatLng> polylineCoordinates = [];
|
||||
mapBloc.sinkPolylines.add(polylineCoordinates);
|
||||
MapsLauncher.launchCoordinates(devicelat, devicelng);
|
||||
MapsLauncher.launchCoordinates(deviceLat, deviceLng);
|
||||
},
|
||||
icon: IconConstants.instance
|
||||
.getMaterialIcon(Icons.near_me_rounded),
|
||||
icon: IconConstants.instance.getMaterialIcon(Icons.near_me_rounded),
|
||||
label: Text(
|
||||
appLocalization(context).map_stream,
|
||||
),
|
||||
|
||||
@@ -52,7 +52,6 @@ showNearPlacesSideSheet(
|
||||
padding: context.paddingLow,
|
||||
width: screenWidth,
|
||||
height: screenHeight / 3,
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user