Show badge for platform Show time deviations (delays, arriving early) Move to API v3
55 lines
1.7 KiB
Dart
55 lines
1.7 KiB
Dart
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'station_data.g.dart';
|
|
|
|
@JsonSerializable()
|
|
class StationData {
|
|
final String date;
|
|
final String stationName;
|
|
final List<StationArrDep>? arrivals;
|
|
final List<StationArrDep>? 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 StationArrDep {
|
|
final int? stoppingTime;
|
|
final DateTime time;
|
|
final StationTrain train;
|
|
final StationStatus status;
|
|
|
|
const StationArrDep({required this.stoppingTime, required this.time, required this.train, required this.status,});
|
|
|
|
factory StationArrDep.fromJson(Map<String, dynamic> json) => _$StationArrDepFromJson(json);
|
|
Map<String, dynamic> toJson() => _$StationArrDepToJson(this);
|
|
}
|
|
|
|
@JsonSerializable()
|
|
class StationTrain {
|
|
final String rank;
|
|
final String number;
|
|
final String operator;
|
|
final String terminus;
|
|
final List<String>? route;
|
|
|
|
StationTrain({required this.rank, required this.number, required this.operator, required this.terminus, this.route,});
|
|
|
|
factory StationTrain.fromJson(Map<String, dynamic> json) => _$StationTrainFromJson(json);
|
|
Map<String, dynamic> toJson() => _$StationTrainToJson(this);
|
|
}
|
|
|
|
@JsonSerializable()
|
|
class StationStatus {
|
|
final int delay;
|
|
final bool real;
|
|
final String? platform;
|
|
|
|
StationStatus({required this.delay, required this.real, required this.platform});
|
|
|
|
factory StationStatus.fromJson(Map<String, dynamic> json) => _$StationStatusFromJson(json);
|
|
Map<String, dynamic> toJson() => _$StationStatusToJson(this);
|
|
}
|