fetchRouteETA method
Future<List<MFRouteETAResult> >
fetchRouteETA(
- List<
MFLocationComponent> origins, - MFLocationComponent destination, {
- MFTravelMode mode = MFTravelMode.car,
- MFRouteWeighting weighting = MFRouteWeighting.fastest,
- MFLanguageResult language = MFLanguageResult.vi,
- MFRouteRestriction? restriction,
Estimated time of arrival.
Implementation
Future<List<MFRouteETAResult>> fetchRouteETA(
List<MFLocationComponent> origins,
MFLocationComponent destination, {
MFTravelMode mode = MFTravelMode.car,
MFRouteWeighting weighting = MFRouteWeighting.fastest,
MFLanguageResult language = MFLanguageResult.vi,
MFRouteRestriction? restriction,
}) async {
final Map<String, Object> data = <String, Object>{
'origins': locationsToJson(origins),
'destination': destination.toJson(),
'mode': mode.index,
'weighting': weighting.index,
'language': language.index,
};
if (restriction != null) {
data['restriction'] = restriction.toJson();
}
final response = await _ServicesChannel.invokeService('route#eta', data);
validateResponse(response);
return toListRouteETA(response!['result']);
}