|
|
|
|
@ -216,70 +216,6 @@ class _MapTrackingPageState extends State<MapTrackingPage> {
|
|
|
|
|
|
|
|
|
|
// if (!inAppView || )
|
|
|
|
|
if (markers.isNotEmpty) MarkerLayer(markers: markers),
|
|
|
|
|
if (inAppView)
|
|
|
|
|
Positioned(
|
|
|
|
|
bottom: 0,
|
|
|
|
|
left: 0,
|
|
|
|
|
right: 0,
|
|
|
|
|
child: Selector<AssetTrackingProvider, List<AssetTrackingModel>>(
|
|
|
|
|
selector: (_, myModel) => myModel.assetsOnTheFloorList,
|
|
|
|
|
builder: (_, assetsOnTheFloorList, __) {
|
|
|
|
|
return assetsOnTheFloorList.isEmpty
|
|
|
|
|
? const SizedBox()
|
|
|
|
|
: Container(
|
|
|
|
|
margin: const EdgeInsets.all(16),
|
|
|
|
|
padding: const EdgeInsets.only(right: 0, left: 0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: AppColor.tabBarBackground(context),
|
|
|
|
|
border: Border.all(color: AppColor.tabBarBorder(context)),
|
|
|
|
|
borderRadius: BorderRadius.circular(20),
|
|
|
|
|
),
|
|
|
|
|
child: UpwardExpansionTile(title: InfoTextLabelWidget(label: "${assetsOnTheFloorList.length} Assets found on this floor"), children: [
|
|
|
|
|
LimitedBox(
|
|
|
|
|
maxHeight: 120,
|
|
|
|
|
child: MultipleItemDropDownMenu<AssetTrackingModel, NullableLoadingProvider>(
|
|
|
|
|
context: context,
|
|
|
|
|
title: 'Assets on The Floor',
|
|
|
|
|
hintMsg: 'Search By Label or Serial Number',
|
|
|
|
|
initialValue: [],
|
|
|
|
|
showShadow: false,
|
|
|
|
|
staticData: assetsOnTheFloorList,
|
|
|
|
|
showCancel: true,
|
|
|
|
|
showAsFullScreenDialog: true,
|
|
|
|
|
onSelect: (selectedAssets) {
|
|
|
|
|
setState(() {
|
|
|
|
|
markers = [
|
|
|
|
|
for (var asset in selectedAssets!)
|
|
|
|
|
Marker(
|
|
|
|
|
point: LatLng(asset.location!.latitude!, asset.location!.longitude!),
|
|
|
|
|
child: Tooltip(
|
|
|
|
|
triggerMode: TooltipTriggerMode.tap,
|
|
|
|
|
message: "Last seen: ${asset.location?.lastSeen?.toServiceRequestDetailsFormat}",
|
|
|
|
|
child: const Icon(Icons.location_pin, color: AppColor.red30),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
];
|
|
|
|
|
});
|
|
|
|
|
// markers
|
|
|
|
|
},
|
|
|
|
|
).paddingOnly(start: 16, end: 16, top: 16),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// Column(
|
|
|
|
|
// mainAxisSize: MainAxisSize.min,
|
|
|
|
|
// children: [
|
|
|
|
|
// Container(
|
|
|
|
|
// width: 50.toScreenWidth,
|
|
|
|
|
// height: 6.toScreenHeight,
|
|
|
|
|
// decoration: BoxDecoration(color: AppColor.white50, borderRadius: BorderRadius.circular(30)),
|
|
|
|
|
// ).center,
|
|
|
|
|
// InfoTextLabelWidget(label: "There is ${assetsOnTheFloorList.length} assets on this floor"),
|
|
|
|
|
// ],
|
|
|
|
|
// ).bottomSheetContainer(context, padding: const EdgeInsets.all(16));
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
if (inAppView)
|
|
|
|
|
Selector<AssetTrackingProvider, List<Coordinates>>(
|
|
|
|
|
@ -300,8 +236,72 @@ class _MapTrackingPageState extends State<MapTrackingPage> {
|
|
|
|
|
borderStrokeWidth: 2.0,
|
|
|
|
|
),
|
|
|
|
|
];
|
|
|
|
|
return PolygonLayer(polygons: zonesPolygons);
|
|
|
|
|
return PolygonLayer(polygons: zonesPolygons, hitNotifier: _polygonHitNotifier);
|
|
|
|
|
}),
|
|
|
|
|
if (_geojson != null && inAppView)
|
|
|
|
|
Positioned(
|
|
|
|
|
bottom: 0,
|
|
|
|
|
left: 0,
|
|
|
|
|
right: 0,
|
|
|
|
|
child: Selector<AssetTrackingProvider, List<AssetTrackingModel>>(
|
|
|
|
|
selector: (_, myModel) => myModel.assetsOnTheFloorList,
|
|
|
|
|
builder: (_, assetsOnTheFloorList, __) {
|
|
|
|
|
return assetsOnTheFloorList.isEmpty
|
|
|
|
|
? const SizedBox()
|
|
|
|
|
: Container(
|
|
|
|
|
margin: const EdgeInsets.all(16),
|
|
|
|
|
padding: const EdgeInsets.only(right: 0, left: 0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: AppColor.tabBarBackground(context),
|
|
|
|
|
border: Border.all(color: AppColor.tabBarBorder(context)),
|
|
|
|
|
borderRadius: BorderRadius.circular(20),
|
|
|
|
|
),
|
|
|
|
|
child: UpwardExpansionTile(title: InfoTextLabelWidget(label: "${assetsOnTheFloorList.length} Assets found on this floor"), children: [
|
|
|
|
|
LimitedBox(
|
|
|
|
|
maxHeight: 120,
|
|
|
|
|
child: MultipleItemDropDownMenu<AssetTrackingModel, NullableLoadingProvider>(
|
|
|
|
|
context: context,
|
|
|
|
|
title: 'Assets on The Floor',
|
|
|
|
|
hintMsg: 'Search By Label or Serial Number',
|
|
|
|
|
initialValue: [],
|
|
|
|
|
showShadow: false,
|
|
|
|
|
staticData: assetsOnTheFloorList,
|
|
|
|
|
showCancel: true,
|
|
|
|
|
showAsFullScreenDialog: true,
|
|
|
|
|
onSelect: (selectedAssets) {
|
|
|
|
|
setState(() {
|
|
|
|
|
markers = [
|
|
|
|
|
for (var asset in selectedAssets!)
|
|
|
|
|
Marker(
|
|
|
|
|
point: LatLng(asset.location!.latitude!, asset.location!.longitude!),
|
|
|
|
|
child: Tooltip(
|
|
|
|
|
triggerMode: TooltipTriggerMode.tap,
|
|
|
|
|
message: "Last seen: ${asset.location?.lastSeen?.toServiceRequestDetailsFormat}",
|
|
|
|
|
child: const Icon(Icons.location_pin, color: AppColor.red30),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
];
|
|
|
|
|
});
|
|
|
|
|
// markers
|
|
|
|
|
},
|
|
|
|
|
).paddingOnly(start: 16, end: 16, top: 16),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// Column(
|
|
|
|
|
// mainAxisSize: MainAxisSize.min,
|
|
|
|
|
// children: [
|
|
|
|
|
// Container(
|
|
|
|
|
// width: 50.toScreenWidth,
|
|
|
|
|
// height: 6.toScreenHeight,
|
|
|
|
|
// decoration: BoxDecoration(color: AppColor.white50, borderRadius: BorderRadius.circular(30)),
|
|
|
|
|
// ).center,
|
|
|
|
|
// InfoTextLabelWidget(label: "There is ${assetsOnTheFloorList.length} assets on this floor"),
|
|
|
|
|
// ],
|
|
|
|
|
// ).bottomSheetContainer(context, padding: const EdgeInsets.all(16));
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
Positioned(
|
|
|
|
|
top: 70,
|
|
|
|
|
right: 8,
|
|
|
|
|
@ -430,7 +430,9 @@ class _MapTrackingPageState extends State<MapTrackingPage> {
|
|
|
|
|
assetTrackingProvider.notify();
|
|
|
|
|
|
|
|
|
|
assetTrackingProvider.getAssetsFromPenguinByFloor();
|
|
|
|
|
if (assetProvider.selectedFloor != null) {
|
|
|
|
|
if (assetProvider.selectedFloor == null) {
|
|
|
|
|
assetTrackingProvider.getZoneFromPenguin();
|
|
|
|
|
} else if (assetProvider.selectedFloor != null) {
|
|
|
|
|
getFloorMap(assetProvider.selectedFloor!.id!);
|
|
|
|
|
assetTrackingProvider.getZoneFromPenguin();
|
|
|
|
|
} else {
|
|
|
|
|
|