getCurrentPosition method
Implementation
@override
Future<Position> getCurrentPosition({
LocationSettings? locationSettings,
}) async {
try {
final result = await methodChannel.invokeMapMethod<String, dynamic>(
'getCurrentPosition',
locationSettings?.toJson() ?? const <String, dynamic>{},
);
if (result == null) {
throw PositionUpdateException('Platform returned no position');
}
return Position.fromMap(result);
} on PlatformException catch (e) {
throw _mapException(e);
}
}