improvement

main_production_asset_tracking
Sikander Saleem 4 weeks ago
parent 2d6e17c4a0
commit caee6edf1b

@ -141,10 +141,13 @@ class _MapTrackingPageState extends State<MapTrackingPage> {
_lastFittedCoordinatesKey = null; // force re-fit even if the same building is viewed again _lastFittedCoordinatesKey = null; // force re-fit even if the same building is viewed again
}); });
Utils.showLoading(context); // Only show the loader when zones must be fetched; if they are cached the call completes
// before the (post-frame) dialog appears, and the dialog would never be dismissed.
final needsNetwork = provider.zonesList.isEmpty;
if (needsNetwork) Utils.showLoading(context);
await provider.getZoneFromPenguin(); await provider.getZoneFromPenguin();
if (!mounted) return; if (!mounted) return;
Utils.hideLoading(context); if (needsNetwork) Utils.hideLoading(context);
// Camera fit happens in the building-outline Selector once the polygon is rendered. // Camera fit happens in the building-outline Selector once the polygon is rendered.
} }
@ -621,6 +624,8 @@ class _MapTrackingPageState extends State<MapTrackingPage> {
onSelect: (value) { onSelect: (value) {
if (value != null) { if (value != null) {
assetProvider.selectedSite = value; assetProvider.selectedSite = value;
assetProvider.selectedBuilding = null;
assetProvider.selectedFloor = null;
getPenguinBuildings(value.id!); getPenguinBuildings(value.id!);
} }
}, },

Loading…
Cancel
Save