Flutterlocation: Location not found on Airplane mode

Created on 11 Mar 2020  路  4Comments  路  Source: Lyokone/flutterlocation

When the device is in airplane mode, the plugin fails to update the location, providing null to the user.

_serviceEnabled = await location.serviceEnabled();
returns TRUE

_permissionGranted = await location.hasPermission();
returns enum PermissionStatus.GRANTED

    location.onLocationChanged().listen((LocationData currentLocation) {
      onLocationChanging(currentLocation);
      print("location changed");
    });

    _locationData = await location.getLocation();
    print(_locationData);

onLocationChanged() never called, and the _locationData print returns NULL.

However, the "bluedot" location on the GoogleMap plugin returns the correct location, as myLocationEnabled: true, and we know that even in airplane mode the device is still able to receive and use GPS data to get the current location

Current testing on: Android v9 / OxygenOS 9.0.10 mobile device

bug

All 4 comments

Hey, it's been solved with this commit, should be in next version, thanks for the report : https://github.com/Lyokone/flutterlocation/commit/dbb7f8922e3489c05339037b6551b814ab6be598

Hey, it's been solved with this commit, should be in next version, thanks for the report : dbb7f89

Great work, I'll keep an eye out

It was just released with 2.5.4 :)

It was just released with 2.5.4 :)

Works brilliantly, thanks :)

Was this page helpful?
0 / 5 - 0 ratings