NextBuses.fromJson constructor
Creates a new NextBuses instance from a JSON object.
Implementation
factory NextBuses.fromJson(Map<String, dynamic> json) {
return NextBuses(
stopName: json[ApiFields.stopName] ?? '',
predictions: ((json[ApiFields.predictions] as List?) ?? [])
.map((prediction) => Prediction.fromJson(prediction))
.toList(),
);
}