StationOnRoute.fromJson constructor

StationOnRoute.fromJson(
  1. Map json
)

Implementation

factory StationOnRoute.fromJson(Map json) {
  return StationOnRoute(
      stopId: json['stop_id'],
      stopName: json['stop_nam'],
      scheduledArrival: DateTime(
          1970,
          1,
          1,
          int.parse(json["arr_t"].substring(0, 2)),
          int.parse(json["arr_t"].substring(2, 4))),
      estimatedDistance: json['esta_dist'],
      estimatedArrival: json['esta_time'] == null
          ? null
          : DateTime.tryParse(json['esta_time']));
}