RealTrip.fromJson constructor

RealTrip.fromJson(
  1. Map json
)

Implementation

factory RealTrip.fromJson(Map json) {
  return RealTrip(
      estimatedArrival:
          json['aet'] != null ? DateTime.tryParse(json['aet']) : null,
      lat: json['lastCoords']['lat'],
      long: json['lastCoords']['lng'],
      id: int.parse(json['id']),
      stats: json['bus'] != null
          ? RealTripBusStats.fromJson(json['bus'])
          : null);
}