RouteResponse.fromJson constructor

RouteResponse.fromJson(
  1. dynamic json
)

Implementation

factory RouteResponse.fromJson(dynamic json) {
  var responseDataJson = json['data'] as List;
  List<Route> _routeResults = responseDataJson
      .map((searchJson) => Route.fromJson(searchJson))
      .toList();

  return RouteResponse(
    json['timestamp'] as String,
    json['status'] as int,
    json['message'] as String,
    _routeResults,
  );
}