diff --git a/app/lib/pages/default_page.dart b/app/lib/pages/default_page.dart index eeb3351154c3cad936c4aff8330b31556370f165..badd63c27e5f5805363cc4227ae5411659be0288 100644 --- a/app/lib/pages/default_page.dart +++ b/app/lib/pages/default_page.dart @@ -39,7 +39,12 @@ class _DefaultPageState extends State<DefaultPage> { throw Exception("Failed to fetch measurements: $error"); }); - relationFuture = fetchRelation(); + // Attempt to fetch relation from server if app establishes connection + if (serverConnection){ + relationFuture = fetchRelation(); + } else { // Read last saved data + relationFuture = loadSavedRelation(); + } // Schedule fetchMarkerData to run periodically based on fetchInterval const Duration interval = Duration(minutes: fetchInterval); // NB fetchInterval value to be determined diff --git a/app/lib/widgets/choropleth_map.dart b/app/lib/widgets/choropleth_map.dart index a53409b582f1e620e6d79e48ac874785f94d9947..2ab4eb52757d577b7095eefde673b8a3157e206f 100644 --- a/app/lib/widgets/choropleth_map.dart +++ b/app/lib/widgets/choropleth_map.dart @@ -40,7 +40,6 @@ class _ChoroplethMapState extends State<ChoroplethMap> { late MapShapeSource mapShapeSource; late final MapZoomPanBehavior _zoomPanBehavior = MapZoomPanBehavior(); List<SubDiv> subdivisions = <SubDiv>[]; - List<SubDiv> groupDivisions = <SubDiv>[]; @override void initState() {