iDecode
iDecode

Reputation: 28906

How to check precise location status on iOS devices in Flutter?

iOS 14+ devices have Precise Location switch. How can I check if my app has this permission or not?

enter image description here

Upvotes: 1

Views: 1733

Answers (1)

iDecode
iDecode

Reputation: 28906

I assume you already have location permission. Once, you are there, just use geolocator package's helper function getLocationAccuracy like this:

final accuracyStatus = await Geolocator.getLocationAccuracy();
switch(accuracyStatus) {
  case LocationAccuracyStatus.reduced:
    // Precise location switch is OFF.
    break;
  case LocationAccuracyStatus.precise:
    // Precise location switch is ON.
    break;
  case LocationAccuracyStatus.unknown:
    // The platform doesn't support this feature, for example an Android device.
    break;
}

Upvotes: 6

Related Questions