You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
2.2 KiB
69 lines
2.2 KiB
3 years ago
|
import 'package:json_annotation/json_annotation.dart';
|
||
|
|
||
|
part 'station_data.g.dart';
|
||
|
|
||
|
@JsonSerializable()
|
||
|
class StationData {
|
||
|
final String date;
|
||
|
final String stationName;
|
||
|
final List<StationArrival>? arrivals;
|
||
|
final List<StationDeparture>? departures;
|
||
|
|
||
|
const StationData({required this.date, required this.stationName, required this.arrivals, required this.departures});
|
||
|
|
||
|
factory StationData.fromJson(Map<String, dynamic> json) => _$StationDataFromJson(json);
|
||
|
Map<String, dynamic> toJson() => _$StationDataToJson(this);
|
||
|
}
|
||
|
|
||
|
@JsonSerializable()
|
||
|
class StationArrival {
|
||
|
final int? stoppingTime;
|
||
|
final DateTime time;
|
||
|
final StationTrainArr train;
|
||
|
|
||
|
const StationArrival({required this.stoppingTime, required this.time, required this.train,});
|
||
|
|
||
|
factory StationArrival.fromJson(Map<String, dynamic> json) => _$StationArrivalFromJson(json);
|
||
|
Map<String, dynamic> toJson() => _$StationArrivalToJson(this);
|
||
|
}
|
||
|
|
||
|
@JsonSerializable()
|
||
|
class StationDeparture {
|
||
|
final int? stoppingTime;
|
||
|
final DateTime time;
|
||
|
final StationTrainDep train;
|
||
|
|
||
|
const StationDeparture({required this.stoppingTime, required this.time, required this.train,});
|
||
|
|
||
|
factory StationDeparture.fromJson(Map<String, dynamic> json) => _$StationDepartureFromJson(json);
|
||
|
Map<String, dynamic> toJson() => _$StationDepartureToJson(this);
|
||
|
}
|
||
|
|
||
|
@JsonSerializable()
|
||
|
class StationTrainArr {
|
||
|
final String rank;
|
||
|
final String number;
|
||
|
final String operator;
|
||
|
final String origin;
|
||
|
final List<String>? route;
|
||
|
|
||
|
StationTrainArr({required this.rank, required this.number, required this.operator, required this.origin, this.route,});
|
||
|
|
||
|
factory StationTrainArr.fromJson(Map<String, dynamic> json) => _$StationTrainArrFromJson(json);
|
||
|
Map<String, dynamic> toJson() => _$StationTrainArrToJson(this);
|
||
|
}
|
||
|
|
||
|
@JsonSerializable()
|
||
|
class StationTrainDep {
|
||
|
final String rank;
|
||
|
final String number;
|
||
|
final String operator;
|
||
|
final String destination;
|
||
|
final List<String>? route;
|
||
|
|
||
|
StationTrainDep({required this.rank, required this.number, required this.operator, required this.destination, this.route,});
|
||
|
|
||
|
factory StationTrainDep.fromJson(Map<String, dynamic> json) => _$StationTrainDepFromJson(json);
|
||
|
Map<String, dynamic> toJson() => _$StationTrainDepToJson(this);
|
||
|
}
|