|
|
|
@ -216,7 +216,29 @@ class _MapTrackingPageState extends State<MapTrackingPage> {
|
|
|
|
|
|
|
|
|
|
|
|
// if (!inAppView || )
|
|
|
|
// if (!inAppView || )
|
|
|
|
if (markers.isNotEmpty) MarkerLayer(markers: markers),
|
|
|
|
if (markers.isNotEmpty) MarkerLayer(markers: markers),
|
|
|
|
|
|
|
|
],
|
|
|
|
if (inAppView)
|
|
|
|
if (inAppView)
|
|
|
|
|
|
|
|
Selector<AssetTrackingProvider, List<Coordinates>>(
|
|
|
|
|
|
|
|
selector: (_, assetTPro) => assetTPro.coordinates,
|
|
|
|
|
|
|
|
builder: (_, coordinates, __) {
|
|
|
|
|
|
|
|
if (coordinates.isEmpty) return const SizedBox();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<LatLng> list = [
|
|
|
|
|
|
|
|
for (var coordinate in (coordinates)) LatLng(coordinate.latitude!, coordinate.longitude!),
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
List<Polygon> zonesPolygons = [
|
|
|
|
|
|
|
|
Polygon(
|
|
|
|
|
|
|
|
label: assetTrackingProvider.selectedBuilding?.label ?? "",
|
|
|
|
|
|
|
|
labelStyle: AppTextStyles.bodyText2.copyWith(color: AppColor.textColor(context)),
|
|
|
|
|
|
|
|
points: list,
|
|
|
|
|
|
|
|
color: AppColor.red30.withOpacity(0.3),
|
|
|
|
|
|
|
|
borderColor: AppColor.red30,
|
|
|
|
|
|
|
|
borderStrokeWidth: 2.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
return PolygonLayer(polygons: zonesPolygons, hitNotifier: _polygonHitNotifier);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
if (_geojson != null && inAppView)
|
|
|
|
Positioned(
|
|
|
|
Positioned(
|
|
|
|
bottom: 0,
|
|
|
|
bottom: 0,
|
|
|
|
left: 0,
|
|
|
|
left: 0,
|
|
|
|
@ -280,28 +302,6 @@ class _MapTrackingPageState extends State<MapTrackingPage> {
|
|
|
|
// ).bottomSheetContainer(context, padding: const EdgeInsets.all(16));
|
|
|
|
// ).bottomSheetContainer(context, padding: const EdgeInsets.all(16));
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
|
|
|
|
if (inAppView)
|
|
|
|
|
|
|
|
Selector<AssetTrackingProvider, List<Coordinates>>(
|
|
|
|
|
|
|
|
selector: (_, assetTPro) => assetTPro.coordinates,
|
|
|
|
|
|
|
|
builder: (_, coordinates, __) {
|
|
|
|
|
|
|
|
if (coordinates.isEmpty) return const SizedBox();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<LatLng> list = [
|
|
|
|
|
|
|
|
for (var coordinate in (coordinates)) LatLng(coordinate.latitude!, coordinate.longitude!),
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
List<Polygon> zonesPolygons = [
|
|
|
|
|
|
|
|
Polygon(
|
|
|
|
|
|
|
|
label: assetTrackingProvider.selectedBuilding?.label ?? "",
|
|
|
|
|
|
|
|
labelStyle: AppTextStyles.bodyText2.copyWith(color: AppColor.textColor(context)),
|
|
|
|
|
|
|
|
points: list,
|
|
|
|
|
|
|
|
color: AppColor.red30.withOpacity(0.3),
|
|
|
|
|
|
|
|
borderColor: AppColor.red30,
|
|
|
|
|
|
|
|
borderStrokeWidth: 2.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
return PolygonLayer(polygons: zonesPolygons);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
Positioned(
|
|
|
|
Positioned(
|
|
|
|
top: 70,
|
|
|
|
top: 70,
|
|
|
|
right: 8,
|
|
|
|
right: 8,
|
|
|
|
@ -430,7 +430,9 @@ class _MapTrackingPageState extends State<MapTrackingPage> {
|
|
|
|
assetTrackingProvider.notify();
|
|
|
|
assetTrackingProvider.notify();
|
|
|
|
|
|
|
|
|
|
|
|
assetTrackingProvider.getAssetsFromPenguinByFloor();
|
|
|
|
assetTrackingProvider.getAssetsFromPenguinByFloor();
|
|
|
|
if (assetProvider.selectedFloor != null) {
|
|
|
|
if (assetProvider.selectedFloor == null) {
|
|
|
|
|
|
|
|
assetTrackingProvider.getZoneFromPenguin();
|
|
|
|
|
|
|
|
} else if (assetProvider.selectedFloor != null) {
|
|
|
|
getFloorMap(assetProvider.selectedFloor!.id!);
|
|
|
|
getFloorMap(assetProvider.selectedFloor!.id!);
|
|
|
|
assetTrackingProvider.getZoneFromPenguin();
|
|
|
|
assetTrackingProvider.getZoneFromPenguin();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|