fetchGraphRoute method
Future<List<MFGraphRouteResult> >
fetchGraphRoute(
- List<
MFLocationComponent> locations, { - MFTravelMode mode = MFTravelMode.car,
- MFRouteWeighting weighting = MFRouteWeighting.fastest,
- MFLanguageResult language = MFLanguageResult.vi,
- MFRouteRestriction? restriction,
Graph route.
Implementation
Future<List<MFGraphRouteResult>> fetchGraphRoute(
List<MFLocationComponent> locations, {
MFTravelMode mode = MFTravelMode.car,
MFRouteWeighting weighting = MFRouteWeighting.fastest,
MFLanguageResult language = MFLanguageResult.vi,
MFRouteRestriction? restriction,
}) async {
final Map<String, Object> data = <String, Object>{
'points': locationsToJson(locations),
'mode': mode.index,
'weighting': weighting.index,
'language': language.index,
};
if (restriction != null) {
data['restriction'] = restriction.toJson();
}
final response = await _ServicesChannel.invokeService('route#graph', data);
validateResponse(response);
return toListGraphRoute(response!['result']);
}