addItineraryFromUserLocation method

Future<void> addItineraryFromUserLocation({
  1. required Coordinate destination,
  2. ItinerarySearchOptions? searchOptions,
  3. Color? color,
  4. bool updateUserLocation = false,
})

add itinerary from user location to the specified destination

this method checks first if user location is available, then it adds the itinerary. in case no user location found, it automatically calls locateMe method and then add itinerary

Implementation

Future<void> addItineraryFromUserLocation(
    {required Coordinate destination,
    ItinerarySearchOptions? searchOptions,
    Color? color,
      /// This property allow to force the update of user location
      ///
      /// this property calls [locateMe] even if user location is provided.
      /// NB: usually used only in case of degraded position
      ///   to retrieve an accurate one.
      ///   in case of VPS as ([MapOptions.locationSource]) a scan will be started
    bool updateUserLocation = false}) async {
  ItineraryWidget._startPointType = ItineraryStartPointType.userLocation;
  await _channel.invokeMethod('addItineraryFromUserLocation', {
    "destination": destination.toMap(),
    "searchOptions":
        searchOptions?.toMap() ?? ItinerarySearchOptions().toMap(),
    "red": color?.red,
    "green": color?.green,
    "blue": color?.blue,
    "alpha": color?.alpha,
    "updateUserLocation": updateUserLocation,
  });
}