using flutter_polyline_points 0.2.4 not working but 0.1.0 works

115

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.

Share:
115
michaelmjous
Author by

michaelmjous

Updated on December 26, 2022

Comments

  • michaelmjous
    michaelmjous over 1 year

    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

  • michaelmjous
    michaelmjous over 3 years
    Thanks the package sample also helped
  • jabamataro
    jabamataro over 3 years
    Glad that helped!