michaelmjous
michaelmjous

Reputation: 33

using flutter_polyline_points 0.2.4 not working but 0.1.0 works

i upgraded my pub file and updated my flutter_polyline_points dependency from 0.1.0 to 0.2.4 had error saying this method accepts only 3 parameters and am making use of 5.

List<PointLatLng> result = await polylinePoints?.getRouteBetweenCoordinates(
            googleAPIKey,
            sourceLocatioon.latitude,
            sourceLocatioon.longitude,
            destLocatioon.latitude,
            destLocatioon.longitude

        );

but it works in flutter_polyline_points 0.1.0

Upvotes: 1

Views: 323

Answers (1)

jabamataro
jabamataro

Reputation: 1232

Use PointLatLng() when passing LatLng values to the getRouteBetweenCoordinates() method. For example:

List<PointLatLng> result = await polylinePoints?.getRouteBetweenCoordinates(
   googleAPIKey,
   PointLatLng(sourceLocatioon.latitude, sourceLocatioon.longitude),
   PointLatLng(destLocatioon.latitude, destLocatioon.longitude)
);

The new PointLatLng method is included in flutter_polyline_points: 0.2.4 package that is used for passing in the origin and destination coordinates. Check the package sample here.

Upvotes: 1

Related Questions