ScheduleAtStop.fromJson constructor
Creates a new ScheduleAtStop from a JSON object.
Implementation
factory ScheduleAtStop.fromJson(Map<String, dynamic> json) {
return ScheduleAtStop(
arrivals: ((json[ApiFields.scheduleArrivals] as List?) ?? [])
.map((arrival) => ScheduleArrival.fromJson(arrival))
.toList(),
stop: Stop.fromJson(json[ApiFields.stop] ?? {}),
);
}