requestPermission method
Requests location permission from the user.
Shows the system permission dialog if the permission has not been permanently denied. Returns the resulting LocationPermissionStatus.
Implementation
@override
Future<LocationPermissionStatus> requestPermission() async {
try {
final status = await methodChannel.invokeMethod<String>(
'requestPermission',
);
return _permissionStatusFromString(status);
} on PlatformException catch (e) {
throw LocationPlatformException(
message: e.message ?? 'Failed to request permission',
code: e.code,
);
}
}