getPolylineCoordinatesWithAddress method

Future<List<LatLng>?> getPolylineCoordinatesWithAddress({
  1. required String origin,
  2. required String destination,
  3. required RouteMode mode,
})

Get coordinates using Location Coordinates Example : '55 Kingston Ave, Brooklyn, NY 11213, USA'

Implementation

Future<List<LatLng>?> getPolylineCoordinatesWithAddress({
  required String origin,
  required String destination,
  required RouteMode mode,
}) async {
  _data = new PolylineRequestData(
      originText: origin,
      destinationText: destination,
      mode: mode,
      locationText: true,
      apiKey: apiKey);

  _utils = new PolylineUtils(_data);

  return await _utils.getCoordinates();
}