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

Update ReadMe ^2.0.0 - Third method # #86

Open adarshwebcastle opened 1 year ago

adarshwebcastle commented 1 year ago

I'm trying to use Third method # getRouteWithAlternatives using the version ^2.0.0 of this package as shown in the readMe to get alternative routes, but for this function it's params changed and showing an error like The named parameter 'request' is required, but there's no corresponding argument. (Documentation) Try adding the required argument. so an update to the readME file is required to show how to use this method

previous method: - result = await PolylinePoints().getRouteWithAlternatives(googleAPiKey, _originLatitude, _originLongitude, _destLatitude, _destLongitude);

new function params - getRouteWithAlternatives( {required PolylineRequest request})

speedlightwp commented 9 months ago

Will the alternative routes support avoidTolls/avoidHighways?

adarshwebcastle commented 4 months ago

Will the alternative routes support avoidTolls/avoidHighways?

Yes,

lib/src/utils/polyline_request.dart

class PolylineRequest {
  final PointLatLng origin;
  final PointLatLng destination;
  final TravelMode mode;
  final String apiKey;
  final List<PolylineWayPoint> wayPoints;
  final bool avoidHighways;
  final bool avoidTolls;
  final bool avoidFerries;
  final bool optimizeWaypoints;