updateLocation method

Future<Location> updateLocation(
  1. String locationName, {
  2. NavigationPosition? position,
  3. String? newName,
  4. Map<String, dynamic>? extra,
})

Change a saved location's position and/or its name. Omitted values are left unchanged. Renaming a location updates every route waypoint that references it.

// Example:
final location = await myNavigationService.updateLocation('kitchen', newName: 'galley');

For more information, see the navigation service docs.

Implementation

Future<Location> updateLocation(
  String locationName, {
  NavigationPosition? position,
  String? newName,
  Map<String, dynamic>? extra,
}) async {
  final request = UpdateLocationRequest(
    name: name,
    locationName: locationName,
    position: position,
    newName: newName,
    extra: extra?.toStruct(),
  );
  final response = await client.updateLocation(request, options: callOptions);
  return response.location;
}