DrivingDirections.fromJson constructor

DrivingDirections.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory DrivingDirections.fromJson(Map<String, dynamic> json) {
  List<EasyRoute> routes = (json['routes'] as List)
      .map((routeJson) => EasyRoute.fromJson(routeJson))
      .toList();

  List<Waypoint> waypoints = (json['waypoints'] as List)
      .map((waypointJson) => Waypoint.fromJson(waypointJson))
      .toList();

  return DrivingDirections(
    code: json['code'],
    routes: routes,
    waypoints: waypoints,
  );
}