getRouteWithAlternatives method
Get the list of coordinates between two geographical positions with alternative routes which can be used to draw polyline between this two positions
Implementation
Future<List<PolylineResult>> getRouteWithAlternatives(
{required PolylineRequest request}) async {
assert(request.apiKey.isNotEmpty, "Google API Key cannot be empty");
assert(request.arrivalTime == null || request.departureTime == null,
"You can only specify either arrival time or departure time");
try {
return await NetworkUtil().getRouteBetweenCoordinates(request: request);
} catch (e) {
rethrow;
}
}