Public Access
feat(departures): add direction info to departures
This commit is contained in:
@@ -780,6 +780,7 @@ class Departure {
|
||||
|
||||
int? id;
|
||||
String ref;
|
||||
String direction;
|
||||
String vehicleId;
|
||||
String vehicleName;
|
||||
String stationId;
|
||||
@@ -790,6 +791,7 @@ class Departure {
|
||||
Departure({
|
||||
this.id,
|
||||
required this.ref,
|
||||
required this.direction,
|
||||
required this.vehicleId,
|
||||
required this.vehicleName,
|
||||
required this.stationId,
|
||||
@@ -802,6 +804,7 @@ class Departure {
|
||||
return {
|
||||
"id": id,
|
||||
"ref": ref,
|
||||
"direction": direction,
|
||||
"vehicle": vehicleId,
|
||||
"vehiclename": vehicleName,
|
||||
"station": stationId,
|
||||
@@ -815,6 +818,7 @@ class Departure {
|
||||
return Departure(
|
||||
id: map["id"] as int,
|
||||
ref: map["ref"] as String,
|
||||
direction: map["direction"] as String,
|
||||
vehicleId: map["vehicle"] as String,
|
||||
vehicleName: map["vehiclename"] as String,
|
||||
stationId: map["station"] as String,
|
||||
@@ -869,6 +873,9 @@ class Departure {
|
||||
// ["JourneyDetailRef"]["ref"] cannot be caught if ["JourneyDetailRef"]
|
||||
// is non-existent
|
||||
ref: json["ref"] ?? json["JourneyDetailRef"]["ref"] as String,
|
||||
direction:
|
||||
json["direction"] ??
|
||||
json["Directions"]["Direction"][0]["value"], // this is not healthy
|
||||
vehicleId: vehicle.id,
|
||||
vehicleName: vehicle.name,
|
||||
stationId: station.id,
|
||||
|
||||
Reference in New Issue
Block a user