| 1 | import 'package:json_annotation/json_annotation.dart'; |
| 2 | |
| 3 | part 'flight.g.dart'; |
| 4 | |
| 5 | enum FlightType { |
| 6 | arrival, |
| 7 | departure, |
| 8 | } |
| 9 | |
| 10 | enum FlightStatus { |
| 11 | scheduled, |
| 12 | active, |
| 13 | landed, |
| 14 | cancelled, |
| 15 | incident, |
| 16 | diverted, |
| 17 | } |
| 18 | |
| 19 | @JsonSerializable() |
| 20 | class Flight { |
| 21 | final String id; |
| 22 | final DateTime date; |
| 23 | final Map<String |
| 24 | final Map<String |
| 25 | final dynamic codeshared; |
| 26 | final Map<String |
| 27 | final Map<String |
| 28 | final FlightType type; |
| 29 | // final FlightStatus? status; |
| 30 | |
| 31 | Flight({ |
| 32 | required this.id, |
| 33 | required this.date, |
| 34 | required this.arrival, |
| 35 | required this.airline, |
| 36 | required this.codeshared, |
| 37 | required this.departure, |
| 38 | required this.flight, |
| 39 | required this.type, |
| 40 | // required this.status, |
| 41 | }); |
| 42 | |
| 43 | factory Flight.fromJson( |
| 44 | |
| 45 | Map<String, dynamic |
| 46 | } |