planToLocation method

Future<Plan> planToLocation(
  1. String locationName, {
  2. NavigationPosition? start,
  3. Map<String, dynamic>? extra,
})

Compute a Plan to a saved location without moving. Accepts the same optional start as planToPoint. Throws if no path exists.

// Example:
final plan = await myNavigationService.planToLocation('kitchen');

For more information, see the navigation service docs.

Implementation

Future<Plan> planToLocation(String locationName, {NavigationPosition? start, Map<String, dynamic>? extra}) async {
  final request = PlanToLocationRequest(name: name, locationName: locationName, start: start, extra: extra?.toStruct());
  final response = await client.planToLocation(request, options: callOptions);
  return response.plan;
}