RouteResponse.fromMap constructor

RouteResponse.fromMap(
  1. Map<String, dynamic> json
)

fromMap method to get the RouteResponse from a json map

Implementation

factory RouteResponse.fromMap(Map<String, dynamic> json) {
  return RouteResponse(
    code: OsrmResponseCode.fromString(json['code']),
    message: json['message'],
    routes: (json['routes'] as List).map((e) {
      return OsrmRoute.fromMap(e);
    }).toList(),
    waypoints: json['waypoints'] != null ? (json['waypoints'] as List).map((e) {
      return OsrmWaypoint.fromMap(e);
    }).toList() : [],
  );
}