toJson method

Map<String, dynamic> toJson()

Returns a JSON representation of this object.

Implementation

Map<String, dynamic> toJson() {
  return {
    ApiFields.carCount: numCars,
    ApiFields.circuitId: int.tryParse(circuitId) ?? -1,
    ApiFields.destinationStationCode: destinationStationCode,
    ApiFields.directionNum: directionNum,
    ApiFields.lineCode: lineCode,
    ApiFields.secondsAtLocation: secondsAtLocation,
    ApiFields.serviceType: serviceType.value,
    ApiFields.trainId: trainId,
    ApiFields.trainNumber: trainNumber,
  };
}