Dammyololade / flutter_polyline_points

A flutter plugin that's decodes encoded google poly line string into list of geo-coordinates suitable for showing route/polyline on maps
MIT License
105 stars 130 forks source link

Fix distance and duration values, basic support for proxy and additional HTTP headers #93

Closed twklessor closed 2 months ago

twklessor commented 6 months ago

Currently distance and duration is not parsed and translated correctly. For example the distance distanceValue and durationValue are not correct and cannot be used as such. They do not include the distance and duration from all the legs.

I have introduced these values for the PolylineResult that is reflected in the legs;

 List<String>? distanceTexts; // All the distance texts
 List<int>? distanceValues; // All the distance values 
 int? totalDistanceValue; // The total distance value
 List<String>? durationTexts; // All the duration texts
 List<int>? durationValues; // All the duration values
 int? totalDurationValue; // The total duration value

I have taken the liberty to not include tests as we basically use reduce to infer values directly from Google.

twklessor commented 5 months ago

@Maouxi You're completely right, I've accepted your change, Thanks!