| 1 | class FlightInfo { |
| 2 | Aircraft? aircraft; |
| 3 | Airline? airline; |
| 4 | Arrival? arrival; |
| 5 | String? codeshareStatus; |
| 6 | Departure? departure; |
| 7 | GreatCircleDistance? greatCircleDistance; |
| 8 | bool? isCargo; |
| 9 | String? lastUpdatedUtc; |
| 10 | String? number; |
| 11 | String? status; |
| 12 | String flightNumber; |
| 13 | String? image; |
| 14 | String id; |
| 15 | |
| 16 | FlightInfo({ |
| 17 | this.aircraft, |
| 18 | this.airline, |
| 19 | this.arrival, |
| 20 | this.codeshareStatus, |
| 21 | this.departure, |
| 22 | this.greatCircleDistance, |
| 23 | this.isCargo, |
| 24 | this.lastUpdatedUtc, |
| 25 | this.number, |
| 26 | this.status, |
| 27 | this.image, |
| 28 | required this.flightNumber, |
| 29 | required this.id, |
| 30 | }); |
| 31 | |
| 32 | FlightInfo.fromJson(Map |
| 33 | : flightNumber = json['flight_no'], |
| 34 | id = json['id'] { |
| 35 | aircraft = json['aircraft'] != null ? |
| 36 | airline = json['airline'] != null ? |
| 37 | arrival = json['arrival'] != null ? |
| 38 | codeshareStatus = json['codeshareStatus']; |
| 39 | departure = json['departure'] != null ? |
| 40 | greatCircleDistance = json['greatCircleDistance'] != null ? |
| 41 | isCargo = json['isCargo']; |
| 42 | lastUpdatedUtc = json['lastUpdatedUtc']; |
| 43 | number = json['number']; |
| 44 | status = json['status']; |
| 45 | image = json['image']; |
| 46 | } |
| 47 | |
| 48 | Map<String, dynamic |
| 49 | final Map<String |
| 50 | if (aircraft != null) { |
| 51 | data['aircraft'] = aircraft!.toJson |
| 52 | } |
| 53 | if (airline != null) { |
| 54 | data['airline'] = airline!.toJson |
| 55 | } |
| 56 | if (arrival != null) { |
| 57 | data['arrival'] = arrival!.toJson |
| 58 | } |
| 59 | data['codeshareStatus'] = codeshareStatus; |
| 60 | if (departure != null) { |
| 61 | data['departure'] = departure!.toJson |
| 62 | } |
| 63 | if (greatCircleDistance != null) { |
| 64 | data['greatCircleDistance'] = greatCircleDistance!.toJson |
| 65 | } |
| 66 | data['isCargo'] = isCargo; |
| 67 | data['lastUpdatedUtc'] = lastUpdatedUtc; |
| 68 | data['number'] = number; |
| 69 | data['status'] = status; |
| 70 | data['image'] = image; |
| 71 | data['id'] = id; |
| 72 | return data; |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | class Aircraft { |
| 77 | String model; |
| 78 | String reg; |
| 79 | String modeS; |
| 80 | |
| 81 | Aircraft({ |
| 82 | required this.model, |
| 83 | required this.modeS, |
| 84 | required this.reg, |
| 85 | }); |
| 86 | |
| 87 | Aircraft.fromJson(Map |
| 88 | : model = json['model'], |
| 89 | reg = json['reg'], |
| 90 | modeS = json['modeS']; |
| 91 | |
| 92 | Map<String, dynamic |
| 93 | final Map<String |
| 94 | data['model'] = model; |
| 95 | data['modeS'] = modeS; |
| 96 | data['reg'] = reg; |
| 97 | return data; |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | class Airline { |
| 102 | String? iata; |
| 103 | String? icao; |
| 104 | String? name; |
| 105 | |
| 106 | Airline({this.iata, |
| 107 | |
| 108 | Airline.fromJson(Map |
| 109 | iata = json['iata']; |
| 110 | icao = json['icao']; |
| 111 | name = json['name']; |
| 112 | } |
| 113 | |
| 114 | Map<String, dynamic |
| 115 | final Map<String |
| 116 | data['iata'] = iata; |
| 117 | data['icao'] = icao; |
| 118 | data['name'] = name; |
| 119 | return data; |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | class Arrival { |
| 124 | Airport? airport; |
| 125 | PredictedTime? predictedTime; |
| 126 | List<String>? quality |
| 127 | PredictedTime? revisedTime; |
| 128 | PredictedTime? scheduledTime; |
| 129 | String? terminal; |
| 130 | |
| 131 | Arrival({this.airport, |
| 132 | |
| 133 | Arrival.fromJson(Map |
| 134 | airport = json['airport'] != null ? |
| 135 | predictedTime = json['predictedTime'] != null ? |
| 136 | quality = json['quality'].cast< |
| 137 | revisedTime = json['revisedTime'] != null ? |
| 138 | scheduledTime = json['scheduledTime'] != null ? |
| 139 | terminal = json['terminal']; |
| 140 | } |
| 141 | |
| 142 | Map<String, dynamic |
| 143 | final Map<String |
| 144 | if (airport != null) { |
| 145 | data['airport'] = airport!.toJson |
| 146 | } |
| 147 | if (predictedTime != null) { |
| 148 | data['predictedTime'] = predictedTime!.toJson |
| 149 | } |
| 150 | data['quality'] = quality; |
| 151 | if (revisedTime != null) { |
| 152 | data['revisedTime'] = revisedTime!.toJson |
| 153 | } |
| 154 | if (scheduledTime != null) { |
| 155 | data['scheduledTime'] = scheduledTime!.toJson |
| 156 | } |
| 157 | data['terminal'] = terminal; |
| 158 | return data; |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | class Airport { |
| 163 | String? countryCode; |
| 164 | String? iata; |
| 165 | String? icao; |
| 166 | Location? location; |
| 167 | String? municipalityName; |
| 168 | String? name; |
| 169 | String? shortName; |
| 170 | String? timeZone; |
| 171 | |
| 172 | Airport({this.countryCode, |
| 173 | |
| 174 | Airport.fromJson(Map |
| 175 | countryCode = json['countryCode']; |
| 176 | iata = json['iata']; |
| 177 | icao = json['icao']; |
| 178 | location = json['location'] != null ? |
| 179 | municipalityName = json['municipalityName']; |
| 180 | name = json['name']; |
| 181 | shortName = json['shortName']; |
| 182 | timeZone = json['timeZone']; |
| 183 | } |
| 184 | |
| 185 | Map<String, dynamic |
| 186 | final Map<String |
| 187 | data['countryCode'] = countryCode; |
| 188 | data['iata'] = iata; |
| 189 | data['icao'] = icao; |
| 190 | if (location != null) { |
| 191 | data['location'] = location!.toJson |
| 192 | } |
| 193 | data['municipalityName'] = municipalityName; |
| 194 | data['name'] = name; |
| 195 | data['shortName'] = shortName; |
| 196 | data['timeZone'] = timeZone; |
| 197 | return data; |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | class Location { |
| 202 | double? lat; |
| 203 | double? lon; |
| 204 | |
| 205 | Location({this.lat, |
| 206 | |
| 207 | Location.fromJson(Map |
| 208 | lat = json['lat']; |
| 209 | lon = json['lon']; |
| 210 | } |
| 211 | |
| 212 | Map<String, dynamic |
| 213 | final Map<String |
| 214 | data['lat'] = lat; |
| 215 | data['lon'] = lon; |
| 216 | return data; |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | class PredictedTime { |
| 221 | String? local; |
| 222 | String? utc; |
| 223 | |
| 224 | PredictedTime({this.local, |
| 225 | |
| 226 | PredictedTime.fromJson(Map |
| 227 | local = json['local']; |
| 228 | utc = json['utc']; |
| 229 | } |
| 230 | |
| 231 | Map<String, dynamic |
| 232 | final Map<String |
| 233 | data['local'] = local; |
| 234 | data['utc'] = utc; |
| 235 | return data; |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | class Departure { |
| 240 | Airport? airport; |
| 241 | String? gate; |
| 242 | List<String>? quality |
| 243 | PredictedTime? revisedTime; |
| 244 | PredictedTime? runwayTime; |
| 245 | PredictedTime? scheduledTime; |
| 246 | String? terminal; |
| 247 | |
| 248 | Departure({ |
| 249 | this.airport, |
| 250 | this.gate, |
| 251 | this.quality, |
| 252 | this.revisedTime, |
| 253 | this.runwayTime, |
| 254 | this.scheduledTime, |
| 255 | this.terminal, |
| 256 | }); |
| 257 | |
| 258 | Departure.fromJson(Map |
| 259 | airport = json['airport'] != null ? |
| 260 | gate = json['gate']; |
| 261 | quality = json['quality'].cast< |
| 262 | revisedTime = json['revisedTime'] != null ? |
| 263 | runwayTime = json['runwayTime'] != null ? |
| 264 | scheduledTime = json['scheduledTime'] != null ? |
| 265 | terminal = json['terminal']; |
| 266 | } |
| 267 | |
| 268 | Map<String, dynamic |
| 269 | final Map<String |
| 270 | if (airport != null) { |
| 271 | data['airport'] = airport!.toJson |
| 272 | } |
| 273 | data['gate'] = gate; |
| 274 | data['quality'] = quality; |
| 275 | if (revisedTime != null) { |
| 276 | data['revisedTime'] = revisedTime!.toJson |
| 277 | } |
| 278 | if (runwayTime != null) { |
| 279 | data['runwayTime'] = runwayTime!.toJson |
| 280 | } |
| 281 | if (scheduledTime != null) { |
| 282 | data['scheduledTime'] = scheduledTime!.toJson |
| 283 | } |
| 284 | if (terminal != null) { |
| 285 | data['terminal'] = terminal; |
| 286 | } |
| 287 | return data; |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | class GreatCircleDistance { |
| 292 | double? feet; |
| 293 | double? km; |
| 294 | double? meter; |
| 295 | double? mile; |
| 296 | double? nm; |
| 297 | |
| 298 | GreatCircleDistance({this.feet, |
| 299 | |
| 300 | GreatCircleDistance.fromJson(Map |
| 301 | feet = json['feet']; |
| 302 | km = json['km']; |
| 303 | meter = json['meter']; |
| 304 | mile = json['mile']; |
| 305 | nm = json['nm']; |
| 306 | } |
| 307 | |
| 308 | Map<String, dynamic |
| 309 | final Map<String |
| 310 | data['feet'] = feet; |
| 311 | data['km'] = km; |
| 312 | data['meter'] = meter; |
| 313 | data['mile'] = mile; |
| 314 | data['nm'] = nm; |
| 315 | return data; |
| 316 | } |
| 317 | } |