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.
42 lines
1.2 KiB
42 lines
1.2 KiB
import 'package:json_annotation/json_annotation.dart'; |
|
|
|
part 'train_operator_lines.g.dart'; |
|
|
|
@JsonSerializable() |
|
class TrainOperatorLines { |
|
@JsonKey(name: "short_name") |
|
final String shortName; |
|
final String operator; |
|
@JsonKey(name: "versiune") |
|
final String version; |
|
@JsonKey(name: "trenuri") |
|
final List<TrainOperatorTrainDescription> trains; |
|
|
|
TrainOperatorLines({ |
|
required this.operator, |
|
this.shortName = "", |
|
required this.version, |
|
required this.trains, |
|
}); |
|
|
|
factory TrainOperatorLines.fromJson(Map<String, dynamic> json) => _$TrainOperatorLinesFromJson(json); |
|
Map<String, dynamic> toJson() => _$TrainOperatorLinesToJson(this); |
|
} |
|
|
|
@JsonSerializable() |
|
class TrainOperatorTrainDescription { |
|
final String rang; |
|
@JsonKey(name: "numar") |
|
final String number; |
|
@JsonKey(name: "numar_intern") |
|
final int internalNumber; |
|
|
|
TrainOperatorTrainDescription({ |
|
this.number = '', |
|
this.rang = '', |
|
this.internalNumber = 0, |
|
}); |
|
|
|
factory TrainOperatorTrainDescription.fromJson(Map<String, dynamic> json) => _$TrainOperatorTrainDescriptionFromJson(json); |
|
Map<String, dynamic> toJson() => _$TrainOperatorTrainDescriptionToJson(this); |
|
}
|
|
|