truckRouteSearch static method

Future<void> truckRouteSearch({
  1. required List<LatLng> wayPoints,
  2. int? drivingMode,
  3. TruckInfo? truckInfo,
  4. int? showFields,
  5. bool onlyOne = true,
  6. RouteResultBack? back,
})

线路规划 truck

Implementation

static Future<void> truckRouteSearch({
  required List<LatLng> wayPoints,
  int? drivingMode,
  TruckInfo? truckInfo,
  int? showFields,//ShowFields.
  bool onlyOne = true,
  RouteResultBack? back,
}) async {
  final String? jsonStr = await _channel.invokeMethod('truckRouteSearch', {
    "wayPointsJson": json.encode(wayPoints),
    "drivingMode": drivingMode,
    "truckInfoJson": json.encode(truckInfo),
    "showFields": showFields,
    "onlyOne": onlyOne,
  });
  if (jsonStr != null) {
    Map? map = json.decode(jsonStr);
    if (map != null && back != null) {
      back(map['code'] as int, RouteResult.fromJson(map["data"]));
    }
  }
}