toJson method
Returns a JSON representation of this NextTrain instance.
Implementation
Map<String, dynamic> toJson() {
return <String, dynamic>{
ApiFields.locationCode: locationCode,
ApiFields.locationName: locationName,
ApiFields.car: numCars?.toString(),
ApiFields.destination: destination,
ApiFields.destinationCode: destinationCode,
ApiFields.destinationName: destinationName,
ApiFields.group: group.toString(),
ApiFields.line: line,
ApiFields.min: specialStatus?.value ?? minutesAway?.toString() ?? '',
};
}