Closed achintya-7 closed 4 months ago
There was a faulty check of the markers list where we trying to access the first element of that list without ensuring if the list is empty or not
Added a sanity check on the markers list
LatLng locationSetter() { if (alertMarkers.isNotEmpty && alertMarkers.first.locationDetails != null && alertMarkers.first.locationDetails!.isNotEmpty) { return LatLng( alertMarkers.first.locationDetails!.last.latitude, alertMarkers.first.locationDetails!.last.longitude, ); } else { return custom; } }
With this, we can prevent access to elements from an empty list.
Implemented a feature to have a custom Latitude and Longitude to be added via the .env file
Latitude
Longitude
DEFAULT_LATITUDE=17.428446 DEFAULT_LONGITUDE=78.302284
When we are rendering the map on the screen, there is a requirement to provide a centre for the map. It has 2 cases
Issue
There was a faulty check of the markers list where we trying to access the first element of that list without ensuring if the list is empty or not
Resolution (Deprecated)
Added a sanity check on the markers list
With this, we can prevent access to elements from an empty list.
Resolution 2:
Implemented a feature to have a custom
Latitude
andLongitude
to be added via the .env fileWhen we are rendering the map on the screen, there is a requirement to provide a centre for the map. It has 2 cases