maplibre / flutter-maplibre-gl

Customizable, performant and vendor-free vector and raster maps, flutter wrapper for maplibre-native and maplibre-gl-js (fork of flutter-mapbox-gl/maps)
https://pub.dev/packages/maplibre_gl
Other
228 stars 125 forks source link

[BUG] Location request hang if location service is unvailable or permissions are denied #508

Open albertmoravec opened 1 month ago

albertmoravec commented 1 month ago

Platforms

android

Version of flutter maplibre_gl

0.20.0

Bug Description

When requestMyLocationLatLng() is called with location service is disabled or permissions were denied, the call hangs indefinitely because of missing else branch which would submit the result here.

Steps to Reproduce

  1. Disable location permissions
  2. Call requestMyLocationLatLng()
  3. Observe the call hanging

Expected Results

Exception describing that location is unavailable.

Actual Results

Call hangs.

Code Sample

final location = await _controller.requestMyLocationLatLng();
print(location)