toJson method

Map<String, dynamic> toJson()

Returns a JSON object which represents this object.

Implementation

Map<String, dynamic> toJson() {
  return {
    ApiFields.direction: direction,
    ApiFields.shape: shape.map((shapePoint) => shapePoint.toJson()).toList(),
    ApiFields.stops: stops.map((stop) => stop.toJson()).toList(),
    ApiFields.tripHeadsign: tripHeadsign,
  };
}