makeRoutes method

  1. @override
List<RoutePath> makeRoutes(
  1. LocationPoint from,
  2. List<LocationPoint> to
)
override

Method is used to build a route between the starting point and several destination points from starting LocationPoint. to destination list of LocationPoints. Returns vector of RoutePaths from starting to destination point.

Example:

// Make routes to multiple destinations
List<LocationPoint> destinations = [
 LocationPoint(point: Point(x: 30.0, y: 40.0), locationId: 12345, sublocationId: 1),
 LocationPoint(point: Point(x: 70.0, y: 80.0), locationId: 12345, sublocationId: 1),
];
List<RoutePath> routePaths = _routeManager!.makeRoutes(startLocationPoint, destinations);
print("Created ${routePaths.length} routes");

Implementation

@override
List<RoutePath> makeRoutes(LocationPoint from, List<LocationPoint> to) {
    final _makeRoutesFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
        Pointer<Void> Function(Pointer<Void>, LocationPointNative, Pointer<Void>),
        Pointer<Void> Function(Pointer<Void>, LocationPointNative, Pointer<Void>)
      >('navigine_sdk_flutter_RouteManager_makeRoutes__From_To'));
    final __resultHandle = _makeRoutesFfi(this.ptr, LocationPointImpl.toNative(from), ListLocationPointImpl.getNativePtr(to));
    final _result = ListRoutePathImpl.fromNativePtr(__resultHandle);
    exception.checkCallResult();
    return _result;
}