addWayPoints method

  1. @override
Future addWayPoints({
  1. required List<LatLng> wayPoints,
})
override

Adds waypoints or stops to an on-going navigation

wayPoints must not be null and have at least 1 item. The way points will be inserted after the currently navigating
waypoint in the existing navigation

Implementation

@override
Future<dynamic> addWayPoints({required List<LatLng> wayPoints}) async {
  assert(wayPoints.isNotEmpty, 'Error: WayPoints must be at least 1');
  final pointList = _getPointListFromWayPoints(wayPoints);
  var i = 0;
  final wayPointMap = {for (var e in pointList) i++: e};
  final args = <String, dynamic>{};
  args['wayPoints'] = wayPointMap;
  await methodChannel.invokeMethod('addWayPoints', args);
}