Skip to content

Commit f99d726

Browse files
committed
Fix OutOfMemory Exception
1 parent 1c2c7c2 commit f99d726

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/api_service.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ class ApiService {
4747
return geojsonFile;
4848
}
4949

50-
Future<String> getGeoJson() async {
50+
Future<String> getGeoJsonUri() async {
5151
await _initializeAndCacheSpots();
5252
final geojsonFile = await getGeoJsonFile();
53-
return await geojsonFile.readAsString();
53+
return geojsonFile.uri.toString();
5454
}
5555

5656
Future<void> clearLocalData() async {

lib/parking_map_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class _ParkingMapScreenState extends State<ParkingMapScreen> {
177177
_isLoading = true;
178178
});
179179

180-
var data = await _apiService.getGeoJson();
180+
var data = await _apiService.getGeoJsonUri();
181181
await _mapboxMap!.style.addSource(
182182
mapbox.GeoJsonSource(id: "spots", data: data, cluster: true),
183183
);

0 commit comments

Comments
 (0)