Getting in between waypoints from flutter_polyline_points plugin

Hi,
I am trying to draw multiple waypoints showing in between source and destination using this flutter_polyline_points plugin. However when i add more than two waypoints as static. but it shows only first point which i added in the waypoint list.
1. Please provide a reason i am getting only one way point (or) suggestions. If may i am wrong please notify where i make a mistake.
2. If any one knows better solution rather than this guide me.

// polyline way points added statically
List wayPoint = [];
wayPoint.add(PolylineWayPoint(“aaa”);
wayPoint.add(PolylineWayPoint(“bbb”);
wayPoint.add(PolylineWayPoint(“ccc”);

// polyline result
PolylineResult result = await polylinePoints.getRouteBetweenCoordinates(
Secrets.API_KEY, // Google Maps API Key
PointLatLng(start.latitude, start.longitude),
PointLatLng(destination.latitude, destination.longitude),
travelMode: TravelMode.driving,
wayPoints: wayPoint,
);

You need to send “location” params in “PolylineWayPoint”.
In your code, issue is in these 3 lines: “wayPoint.add()”

I use this code and it works!

wayPoints.add(PolylineWayPoint(location: ‘$lat1,$lng1’, stopOver: true));
wayPoints.add(PolylineWayPoint(location: ‘$lat2,$lng2’, stopOver: true));