data.dart 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081
  1. import 'dart:convert';
  2. import 'package:jiffy/jiffy.dart';
  3. import 'package:myshelf/models/dtinterval.dart';
  4. List<List<dynamic>> csv2list(String text,
  5. {bool nulling = true, bool quotes = true, bool trim = true}) {
  6. List<List<dynamic>> out = [];
  7. final lines = text.split("\n");
  8. for (var line in lines) {
  9. final cols = line.split(",").map((String? e) {
  10. if (e != null && quotes) {
  11. e = e.replaceAll('"', "");
  12. }
  13. if (e != null && trim) {
  14. e = e.trim();
  15. }
  16. if (nulling) {
  17. e = (e == "") ? null : e;
  18. }
  19. return e;
  20. }).toList();
  21. // print("${out.length}: $cols");
  22. if (cols.isNotEmpty && cols.length > 1) out.add(cols);
  23. }
  24. return out;
  25. }
  26. class Qualif {
  27. String? tlc;
  28. String? lname;
  29. String? mname;
  30. String? fname;
  31. String? date;
  32. String? ac;
  33. String? college;
  34. String? base;
  35. Qualif({
  36. this.tlc,
  37. this.lname,
  38. this.mname,
  39. this.fname,
  40. this.date,
  41. this.ac,
  42. this.college,
  43. this.base,
  44. });
  45. Qualif copyWith({
  46. String? tlc,
  47. String? lname,
  48. String? mname,
  49. String? fname,
  50. String? date,
  51. String? ac,
  52. String? college,
  53. String? base,
  54. }) {
  55. return Qualif(
  56. tlc: tlc ?? this.tlc,
  57. lname: lname ?? this.lname,
  58. mname: mname ?? this.mname,
  59. fname: fname ?? this.fname,
  60. date: date ?? this.date,
  61. ac: ac ?? this.ac,
  62. college: college ?? this.college,
  63. base: base ?? this.base,
  64. );
  65. }
  66. Map<String, dynamic> toMap() {
  67. return <String, dynamic>{
  68. 'tlc': tlc,
  69. 'lname': lname,
  70. 'mname': mname,
  71. 'fname': fname,
  72. 'date': date,
  73. 'ac': ac,
  74. 'college': college,
  75. 'base': base,
  76. };
  77. }
  78. factory Qualif.fromList(List datalist) {
  79. return Qualif(
  80. tlc: datalist[0],
  81. lname: datalist[1],
  82. mname: datalist[2],
  83. fname: datalist[3],
  84. date: datalist[4],
  85. ac: datalist[5],
  86. college: datalist[6],
  87. base: datalist[7]);
  88. }
  89. factory Qualif.fromMap(Map<String, dynamic> map) {
  90. return Qualif(
  91. tlc: map['tlc'] != null ? map['tlc'] as String : null,
  92. lname: map['lname'] != null ? map['lname'] as String : null,
  93. mname: map['mname'] != null ? map['mname'] as String : null,
  94. fname: map['fname'] != null ? map['fname'] as String : null,
  95. date: map['date'] != null ? map['date'] as String : null,
  96. ac: map['ac'] != null ? map['ac'] as String : null,
  97. college: map['college'] != null ? map['college'] as String : null,
  98. base: map['base'] != null ? map['base'] as String : null,
  99. );
  100. }
  101. String toJson() => json.encode(toMap());
  102. factory Qualif.fromJson(String source) =>
  103. Qualif.fromMap(json.decode(source) as Map<String, dynamic>);
  104. @override
  105. String toString() {
  106. return 'Qualif(tlc: $tlc, lname: $lname, mname: $mname, fname: $fname, date: $date, ac: $ac, college: $college, base: $base)';
  107. }
  108. @override
  109. bool operator ==(covariant Qualif other) {
  110. if (identical(this, other)) return true;
  111. return other.tlc == tlc &&
  112. other.lname == lname &&
  113. other.mname == mname &&
  114. other.fname == fname &&
  115. other.date == date &&
  116. other.ac == ac &&
  117. other.college == college &&
  118. other.base == base;
  119. }
  120. @override
  121. int get hashCode {
  122. return tlc.hashCode ^
  123. lname.hashCode ^
  124. mname.hashCode ^
  125. fname.hashCode ^
  126. date.hashCode ^
  127. ac.hashCode ^
  128. college.hashCode ^
  129. base.hashCode;
  130. }
  131. }
  132. class Pnleg {
  133. String? date;
  134. Jiffy? get jdate => date != null
  135. ? Jiffy.parse(date ?? "01/01/1970", pattern: "dd/MM/yyyy", isUtc: true)
  136. : null;
  137. String? tlc;
  138. String? actype;
  139. String? al;
  140. String? fnum;
  141. String? depdate;
  142. String? deptime;
  143. String? arrdate;
  144. String? arrtime;
  145. String? dep;
  146. String? arr;
  147. String? label;
  148. String? type;
  149. Jiffy? get jdep =>
  150. deptime != null ? "$depdate $deptime".parseddmmyyyyhhmm() : null;
  151. Jiffy? get jarr =>
  152. arrtime != null ? "$arrdate $arrtime".parseddmmyyyyhhmm() : null;
  153. String get dutytype {
  154. if (type == "L") {
  155. return "flight";
  156. } else if ((type == "G")) {
  157. return "dhlimo";
  158. } else if ((type == "F") || ((dep ?? "") != "" && (arr ?? "") != "")) {
  159. return "dhflight";
  160. } else if ((label?.startsWith("SBY") ?? false) || (label == "R0")) {
  161. return "standby";
  162. } else if ((!["OFF", "CM", "CA", "PP"].contains(label)) &&
  163. (jarr != null &&
  164. jdep != null &&
  165. DTInterval(jdep!, jarr!).duration.inHours < 18)) {
  166. return "ground";
  167. } else {
  168. return "day";
  169. }
  170. }
  171. Pnleg({
  172. this.date,
  173. this.tlc,
  174. this.actype,
  175. this.al,
  176. this.fnum,
  177. this.depdate,
  178. this.deptime,
  179. this.arrdate,
  180. this.arrtime,
  181. this.dep,
  182. this.arr,
  183. this.label,
  184. this.type,
  185. });
  186. Pnleg copyWith({
  187. String? date,
  188. String? tlc,
  189. String? actype,
  190. String? al,
  191. String? fnum,
  192. String? depdate,
  193. String? deptime,
  194. String? arrdate,
  195. String? arrtime,
  196. String? dep,
  197. String? arr,
  198. String? label,
  199. String? type,
  200. }) {
  201. return Pnleg(
  202. date: date ?? this.date,
  203. tlc: tlc ?? this.tlc,
  204. actype: actype ?? this.actype,
  205. al: al ?? this.al,
  206. fnum: fnum ?? this.fnum,
  207. depdate: depdate ?? this.depdate,
  208. deptime: deptime ?? this.deptime,
  209. arrdate: arrdate ?? this.arrdate,
  210. arrtime: arrtime ?? this.arrtime,
  211. dep: dep ?? this.dep,
  212. arr: arr ?? this.arr,
  213. label: label ?? this.label,
  214. type: type ?? this.type,
  215. );
  216. }
  217. Map<String, dynamic> toMap() {
  218. return <String, dynamic>{
  219. 'date': date,
  220. 'tlc': tlc,
  221. 'actype': actype,
  222. 'al': al,
  223. 'fnum': fnum,
  224. 'depdate': depdate,
  225. 'deptime': deptime,
  226. 'arrdate': arrdate,
  227. 'arrtime': arrtime,
  228. 'dep': dep,
  229. 'arr': arr,
  230. 'label': label,
  231. 'type': type,
  232. };
  233. }
  234. factory Pnleg.fromList(List datalist) {
  235. return Pnleg(
  236. date: datalist[0],
  237. tlc: datalist[1],
  238. actype: datalist[2],
  239. al: datalist[3],
  240. fnum: datalist[4],
  241. depdate: datalist[5],
  242. deptime: datalist[6],
  243. arrdate: datalist[7],
  244. arrtime: datalist[8],
  245. dep: datalist[9],
  246. arr: datalist[10],
  247. label: datalist[11],
  248. type: datalist[12]);
  249. }
  250. factory Pnleg.fromMap(Map<String, dynamic> map) {
  251. return Pnleg(
  252. date: map['date'] != null ? map['date'] as String : null,
  253. tlc: map['tlc'] != null ? map['tlc'] as String : null,
  254. actype: map['actype'] != null ? map['actype'] as String : null,
  255. al: map['al'] != null ? map['al'] as String : null,
  256. fnum: map['fnum'] != null ? map['fnum'] as String : null,
  257. depdate: map['depdate'] != null ? map['depdate'] as String : null,
  258. deptime: map['deptime'] != null ? map['deptime'] as String : null,
  259. arrdate: map['arrdate'] != null ? map['arrdate'] as String : null,
  260. arrtime: map['arrtime'] != null ? map['arrtime'] as String : null,
  261. dep: map['dep'] != null ? map['dep'] as String : null,
  262. arr: map['arr'] != null ? map['arr'] as String : null,
  263. label: map['label'] != null ? map['label'] as String : null,
  264. type: map['type'] != null ? map['type'] as String : null,
  265. );
  266. }
  267. String toJson() => json.encode(toMap());
  268. factory Pnleg.fromJson(String source) =>
  269. Pnleg.fromMap(json.decode(source) as Map<String, dynamic>);
  270. @override
  271. String toString() {
  272. return 'Pnleg(date: $date, tlc: $tlc, actype: $actype, al: $al, fnum: $fnum, depdate: $depdate, deptime: $deptime, arrdate: $arrdate, arrtime: $arrtime, dep: $dep, arr: $arr, label: $label, type: $type)';
  273. }
  274. @override
  275. bool operator ==(covariant Pnleg other) {
  276. if (identical(this, other)) return true;
  277. return other.date == date &&
  278. other.tlc == tlc &&
  279. other.actype == actype &&
  280. other.al == al &&
  281. other.fnum == fnum &&
  282. other.depdate == depdate &&
  283. other.deptime == deptime &&
  284. other.arrdate == arrdate &&
  285. other.arrtime == arrtime &&
  286. other.dep == dep &&
  287. other.arr == arr &&
  288. other.label == label &&
  289. other.type == type;
  290. }
  291. @override
  292. int get hashCode {
  293. return date.hashCode ^
  294. tlc.hashCode ^
  295. actype.hashCode ^
  296. al.hashCode ^
  297. fnum.hashCode ^
  298. depdate.hashCode ^
  299. deptime.hashCode ^
  300. arrdate.hashCode ^
  301. arrtime.hashCode ^
  302. dep.hashCode ^
  303. arr.hashCode ^
  304. label.hashCode ^
  305. type.hashCode;
  306. }
  307. }
  308. //enum flt_status { sched, delayed, taxiout, enroute, landed, arrived }
  309. class Acleg {
  310. String? LEG_NO;
  311. String? FN_CARRIER;
  312. String? FN_NUMBER;
  313. String? FN_SUFFIX;
  314. String? DAY_OF_ORIGIN;
  315. String? AC_OWNER;
  316. String? AC_SUBTYPE;
  317. String? AC_VERSION;
  318. String? AC_REGISTRATION;
  319. String? DEP_AP_ACTUAL;
  320. String? DEP_AP_SCHED;
  321. String? DEP_DT_EST;
  322. Jiffy? get jdepest =>
  323. (DEP_DT_EST == null) ? null : DEP_DT_EST!.parseyyyymmddhhmm();
  324. String? DEP_SCHED_DT;
  325. Jiffy? get jdepsched =>
  326. (DEP_SCHED_DT == null) ? null : DEP_SCHED_DT!.parseyyyymmddhhmm();
  327. String? ARR_AP_ACTUAL;
  328. String? ARR_AP_SCHED;
  329. String? ARR_DT_EST;
  330. Jiffy? get jarrest =>
  331. (ARR_DT_EST == null) ? null : ARR_DT_EST!.parseyyyymmddhhmm();
  332. String? ARR_SCHED_DT;
  333. Jiffy? get jarrsched =>
  334. (ARR_SCHED_DT == null) ? null : ARR_SCHED_DT!.parseyyyymmddhhmm();
  335. String? SLOT_TIME_ACTUAL;
  336. Jiffy? get slot =>
  337. (SLOT_TIME_ACTUAL == null) ? null : SLOT_TIME_ACTUAL!.parseyyyymmddhhmm();
  338. String? LEG_TYPE;
  339. String? STATUS;
  340. String? EMPLOYER_COCKPIT;
  341. String? EMPLOYER_CABIN;
  342. String? CYCLES;
  343. String? DELAY_CODE_01;
  344. String? DELAY_CODE_02;
  345. String? DELAY_CODE_03;
  346. String? DELAY_CODE_04;
  347. String? DELAY_TIME_01;
  348. String? DELAY_TIME_02;
  349. String? DELAY_TIME_03;
  350. String? DELAY_TIME_04;
  351. String? SUBDELAY_CODE_01;
  352. String? SUBDELAY_CODE_02;
  353. String? SUBDELAY_CODE_03;
  354. String? SUBDELAY_CODE_04;
  355. List<List> get dla => [
  356. [
  357. SUBDELAY_CODE_01 ?? DELAY_CODE_01,
  358. DELAY_TIME_01 == null
  359. ? null
  360. : Duration(minutes: int.parse(DELAY_TIME_01!))
  361. ],
  362. [
  363. SUBDELAY_CODE_02 ?? DELAY_CODE_02,
  364. DELAY_TIME_02 == null
  365. ? null
  366. : Duration(minutes: int.parse(DELAY_TIME_02!))
  367. ],
  368. [
  369. SUBDELAY_CODE_03 ?? DELAY_CODE_03,
  370. DELAY_TIME_03 == null
  371. ? null
  372. : Duration(minutes: int.parse(DELAY_TIME_03!))
  373. ],
  374. [
  375. SUBDELAY_CODE_04 ?? DELAY_CODE_04,
  376. DELAY_TIME_04 == null
  377. ? null
  378. : Duration(minutes: int.parse(DELAY_TIME_04!))
  379. ],
  380. ].where((e) => e.every((f) => f != null)).toList();
  381. List<String> get delaycode => [
  382. DELAY_CODE_01,
  383. DELAY_CODE_02,
  384. DELAY_CODE_03,
  385. DELAY_CODE_04
  386. ].nonNulls.toList();
  387. List<String> get delaysubcode => [
  388. SUBDELAY_CODE_01,
  389. SUBDELAY_CODE_02,
  390. SUBDELAY_CODE_03,
  391. SUBDELAY_CODE_04
  392. ].nonNulls.toList();
  393. List<Duration?> get delaytime => [
  394. DELAY_TIME_01 == null
  395. ? null
  396. : Duration(minutes: int.parse(DELAY_TIME_01!)),
  397. DELAY_TIME_02 == null
  398. ? null
  399. : Duration(minutes: int.parse(DELAY_TIME_02!)),
  400. DELAY_TIME_03 == null
  401. ? null
  402. : Duration(minutes: int.parse(DELAY_TIME_03!)),
  403. DELAY_TIME_04 == null
  404. ? null
  405. : Duration(minutes: int.parse(DELAY_TIME_04!))
  406. ].nonNulls.toList();
  407. String? PAX_BOOKED_C;
  408. String? PAX_BOOKED_Y;
  409. String? get pax_booked => (PAX_BOOKED_C != null || PAX_BOOKED_Y != null)
  410. ? "${(AC_VERSION != null && AC_VERSION!.contains("C")) ? "C${PAX_BOOKED_C ?? 0}." : ""}Y${PAX_BOOKED_Y ?? 0}"
  411. : null;
  412. String? PAX_BOOKED_TRS_C;
  413. String? PAX_BOOKED_TRS_Y;
  414. String? get pax_trs => (PAX_BOOKED_TRS_C != null || PAX_BOOKED_TRS_Y != null)
  415. ? "C${PAX_BOOKED_TRS_C ?? 0}/Y${PAX_BOOKED_TRS_Y ?? 0}"
  416. : null;
  417. String? PAD_BOOKED_C;
  418. String? PAD_BOOKED_Y;
  419. String? get pad_booked => (PAD_BOOKED_C != null || PAD_BOOKED_Y != null)
  420. ? "C${PAD_BOOKED_C ?? 0}/Y${PAD_BOOKED_Y ?? 0}"
  421. : null;
  422. String? OFFBLOCK_DT_A;
  423. String? AIRBORNE_DT_A;
  424. String? LANDING_DT_A;
  425. String? ONBLOCK_DT_A;
  426. List<Jiffy?> get blocks_a => [
  427. (OFFBLOCK_DT_A ?? "").parseyyyymmddhhmm(),
  428. (AIRBORNE_DT_A ?? "").parseyyyymmddhhmm(),
  429. (LANDING_DT_A ?? "").parseyyyymmddhhmm(),
  430. (ONBLOCK_DT_A ?? "").parseyyyymmddhhmm()
  431. ];
  432. String get flt_status {
  433. if (blocks[3] != null) {
  434. return "Arrived";
  435. } else if (blocks[2] != null) {
  436. return "Landed";
  437. } else if (blocks[1] != null) {
  438. return "Inflight";
  439. } else if (blocks[0] != null) {
  440. return "Taxiout";
  441. } else if (jdepest != null &&
  442. jarrsched != null &&
  443. jdepest!.isAfter(jdepsched!)) {
  444. return "Delayed";
  445. } else {
  446. return "Sched";
  447. }
  448. }
  449. String? OFFBLOCK_DT_F;
  450. String? AIRBORNE_DT_F;
  451. String? LANDING_DT_F;
  452. String? ONBLOCK_DT_F;
  453. List<Jiffy?> get blocks_f => [
  454. (OFFBLOCK_DT_F ?? "").parseyyyymmddhhmm(),
  455. (AIRBORNE_DT_F ?? "").parseyyyymmddhhmm(),
  456. (LANDING_DT_F ?? "").parseyyyymmddhhmm(),
  457. (ONBLOCK_DT_F ?? "").parseyyyymmddhhmm()
  458. ];
  459. String? OFFBLOCK_DT_M;
  460. String? AIRBORNE_DT_M;
  461. String? LANDING_DT_M;
  462. String? ONBLOCK_DT_M;
  463. List<Jiffy?> get blocks_m => [
  464. (OFFBLOCK_DT_M ?? "").parseyyyymmddhhmm(),
  465. (AIRBORNE_DT_M ?? "").parseyyyymmddhhmm(),
  466. (LANDING_DT_M ?? "").parseyyyymmddhhmm(),
  467. (ONBLOCK_DT_M ?? "").parseyyyymmddhhmm()
  468. ];
  469. List<Jiffy?> get blocks => [
  470. blocks_m[0] ?? blocks_a[0] ?? blocks_f[0],
  471. blocks_m[1] ?? blocks_a[1] ?? blocks_f[1],
  472. blocks_m[2] ?? blocks_a[2] ?? blocks_f[2],
  473. blocks_m[3] ?? blocks_a[3] ?? blocks_f[3]
  474. ];
  475. Jiffy? get jdep => blocks[0] ?? jdepest ?? jdepsched;
  476. Jiffy? get jarr =>
  477. blocks[3] ??
  478. blocks[2]?.add(minutes: 5) ??
  479. (eet == null ? null : blocks[1]?.addDuration(eet!).add(minutes: 8)) ??
  480. (eet == null
  481. ? null
  482. : blocks[0]?.add(minutes: 5).addDuration(eet!).add(minutes: 8)) ??
  483. (eet == null
  484. ? null
  485. : jdep?.addDuration(eet!).add(minutes: 8).add(minutes: 5)) ??
  486. jarrest ??
  487. jarrsched;
  488. String? EET;
  489. Duration? get eet => EET == null ? null : Duration(minutes: int.parse(EET!));
  490. Acleg({
  491. this.LEG_NO,
  492. this.FN_CARRIER,
  493. this.FN_NUMBER,
  494. this.FN_SUFFIX,
  495. this.DAY_OF_ORIGIN,
  496. this.AC_OWNER,
  497. this.AC_SUBTYPE,
  498. this.AC_VERSION,
  499. this.AC_REGISTRATION,
  500. this.DEP_AP_ACTUAL,
  501. this.DEP_AP_SCHED,
  502. this.DEP_DT_EST,
  503. this.DEP_SCHED_DT,
  504. this.ARR_AP_ACTUAL,
  505. this.ARR_AP_SCHED,
  506. this.ARR_DT_EST,
  507. this.ARR_SCHED_DT,
  508. this.SLOT_TIME_ACTUAL,
  509. this.LEG_TYPE,
  510. this.STATUS,
  511. this.EMPLOYER_COCKPIT,
  512. this.EMPLOYER_CABIN,
  513. this.CYCLES,
  514. this.DELAY_CODE_01,
  515. this.DELAY_CODE_02,
  516. this.DELAY_CODE_03,
  517. this.DELAY_CODE_04,
  518. this.DELAY_TIME_01,
  519. this.DELAY_TIME_02,
  520. this.DELAY_TIME_03,
  521. this.DELAY_TIME_04,
  522. this.SUBDELAY_CODE_01,
  523. this.SUBDELAY_CODE_02,
  524. this.SUBDELAY_CODE_03,
  525. this.SUBDELAY_CODE_04,
  526. this.PAX_BOOKED_C,
  527. this.PAX_BOOKED_Y,
  528. this.PAX_BOOKED_TRS_C,
  529. this.PAX_BOOKED_TRS_Y,
  530. this.PAD_BOOKED_C,
  531. this.PAD_BOOKED_Y,
  532. this.OFFBLOCK_DT_A,
  533. this.AIRBORNE_DT_A,
  534. this.LANDING_DT_A,
  535. this.ONBLOCK_DT_A,
  536. this.OFFBLOCK_DT_F,
  537. this.AIRBORNE_DT_F,
  538. this.LANDING_DT_F,
  539. this.ONBLOCK_DT_F,
  540. this.OFFBLOCK_DT_M,
  541. this.AIRBORNE_DT_M,
  542. this.LANDING_DT_M,
  543. this.ONBLOCK_DT_M,
  544. this.EET,
  545. });
  546. Acleg copyWith({
  547. String? LEG_NO,
  548. String? FN_CARRIER,
  549. String? FN_NUMBER,
  550. String? FN_SUFFIX,
  551. String? DAY_OF_ORIGIN,
  552. String? AC_OWNER,
  553. String? AC_SUBTYPE,
  554. String? AC_VERSION,
  555. String? AC_REGISTRATION,
  556. String? DEP_AP_ACTUAL,
  557. String? DEP_AP_SCHED,
  558. String? DEP_DT_EST,
  559. String? DEP_SCHED_DT,
  560. String? ARR_AP_ACTUAL,
  561. String? ARR_AP_SCHED,
  562. String? ARR_DT_EST,
  563. String? ARR_SCHED_DT,
  564. String? SLOT_TIME_ACTUAL,
  565. String? LEG_TYPE,
  566. String? STATUS,
  567. String? EMPLOYER_COCKPIT,
  568. String? EMPLOYER_CABIN,
  569. String? CYCLES,
  570. String? DELAY_CODE_01,
  571. String? DELAY_CODE_02,
  572. String? DELAY_CODE_03,
  573. String? DELAY_CODE_04,
  574. String? DELAY_TIME_01,
  575. String? DELAY_TIME_02,
  576. String? DELAY_TIME_03,
  577. String? DELAY_TIME_04,
  578. String? SUBDELAY_CODE_01,
  579. String? SUBDELAY_CODE_02,
  580. String? SUBDELAY_CODE_03,
  581. String? SUBDELAY_CODE_04,
  582. String? PAX_BOOKED_C,
  583. String? PAX_BOOKED_Y,
  584. String? PAX_BOOKED_TRS_C,
  585. String? PAX_BOOKED_TRS_Y,
  586. String? PAD_BOOKED_C,
  587. String? PAD_BOOKED_Y,
  588. String? OFFBLOCK_DT_A,
  589. String? AIRBORNE_DT_A,
  590. String? LANDING_DT_A,
  591. String? ONBLOCK_DT_A,
  592. String? OFFBLOCK_DT_F,
  593. String? AIRBORNE_DT_F,
  594. String? LANDING_DT_F,
  595. String? ONBLOCK_DT_F,
  596. String? OFFBLOCK_DT_M,
  597. String? AIRBORNE_DT_M,
  598. String? LANDING_DT_M,
  599. String? ONBLOCK_DT_M,
  600. String? EET,
  601. }) {
  602. return Acleg(
  603. LEG_NO: LEG_NO ?? this.LEG_NO,
  604. FN_CARRIER: FN_CARRIER ?? this.FN_CARRIER,
  605. FN_NUMBER: FN_NUMBER ?? this.FN_NUMBER,
  606. FN_SUFFIX: FN_SUFFIX ?? this.FN_SUFFIX,
  607. DAY_OF_ORIGIN: DAY_OF_ORIGIN ?? this.DAY_OF_ORIGIN,
  608. AC_OWNER: AC_OWNER ?? this.AC_OWNER,
  609. AC_SUBTYPE: AC_SUBTYPE ?? this.AC_SUBTYPE,
  610. AC_VERSION: AC_VERSION ?? this.AC_VERSION,
  611. AC_REGISTRATION: AC_REGISTRATION ?? this.AC_REGISTRATION,
  612. DEP_AP_ACTUAL: DEP_AP_ACTUAL ?? this.DEP_AP_ACTUAL,
  613. DEP_AP_SCHED: DEP_AP_SCHED ?? this.DEP_AP_SCHED,
  614. DEP_DT_EST: DEP_DT_EST ?? this.DEP_DT_EST,
  615. DEP_SCHED_DT: DEP_SCHED_DT ?? this.DEP_SCHED_DT,
  616. ARR_AP_ACTUAL: ARR_AP_ACTUAL ?? this.ARR_AP_ACTUAL,
  617. ARR_AP_SCHED: ARR_AP_SCHED ?? this.ARR_AP_SCHED,
  618. ARR_DT_EST: ARR_DT_EST ?? this.ARR_DT_EST,
  619. ARR_SCHED_DT: ARR_SCHED_DT ?? this.ARR_SCHED_DT,
  620. SLOT_TIME_ACTUAL: SLOT_TIME_ACTUAL ?? this.SLOT_TIME_ACTUAL,
  621. LEG_TYPE: LEG_TYPE ?? this.LEG_TYPE,
  622. STATUS: STATUS ?? this.STATUS,
  623. EMPLOYER_COCKPIT: EMPLOYER_COCKPIT ?? this.EMPLOYER_COCKPIT,
  624. EMPLOYER_CABIN: EMPLOYER_CABIN ?? this.EMPLOYER_CABIN,
  625. CYCLES: CYCLES ?? this.CYCLES,
  626. DELAY_CODE_01: DELAY_CODE_01 ?? this.DELAY_CODE_01,
  627. DELAY_CODE_02: DELAY_CODE_02 ?? this.DELAY_CODE_02,
  628. DELAY_CODE_03: DELAY_CODE_03 ?? this.DELAY_CODE_03,
  629. DELAY_CODE_04: DELAY_CODE_04 ?? this.DELAY_CODE_04,
  630. DELAY_TIME_01: DELAY_TIME_01 ?? this.DELAY_TIME_01,
  631. DELAY_TIME_02: DELAY_TIME_02 ?? this.DELAY_TIME_02,
  632. DELAY_TIME_03: DELAY_TIME_03 ?? this.DELAY_TIME_03,
  633. DELAY_TIME_04: DELAY_TIME_04 ?? this.DELAY_TIME_04,
  634. SUBDELAY_CODE_01: SUBDELAY_CODE_01 ?? this.SUBDELAY_CODE_01,
  635. SUBDELAY_CODE_02: SUBDELAY_CODE_02 ?? this.SUBDELAY_CODE_02,
  636. SUBDELAY_CODE_03: SUBDELAY_CODE_03 ?? this.SUBDELAY_CODE_03,
  637. SUBDELAY_CODE_04: SUBDELAY_CODE_04 ?? this.SUBDELAY_CODE_04,
  638. PAX_BOOKED_C: PAX_BOOKED_C ?? this.PAX_BOOKED_C,
  639. PAX_BOOKED_Y: PAX_BOOKED_Y ?? this.PAX_BOOKED_Y,
  640. PAX_BOOKED_TRS_C: PAX_BOOKED_TRS_C ?? this.PAX_BOOKED_TRS_C,
  641. PAX_BOOKED_TRS_Y: PAX_BOOKED_TRS_Y ?? this.PAX_BOOKED_TRS_Y,
  642. PAD_BOOKED_C: PAD_BOOKED_C ?? this.PAD_BOOKED_C,
  643. PAD_BOOKED_Y: PAD_BOOKED_Y ?? this.PAD_BOOKED_Y,
  644. OFFBLOCK_DT_A: OFFBLOCK_DT_A ?? this.OFFBLOCK_DT_A,
  645. AIRBORNE_DT_A: AIRBORNE_DT_A ?? this.AIRBORNE_DT_A,
  646. LANDING_DT_A: LANDING_DT_A ?? this.LANDING_DT_A,
  647. ONBLOCK_DT_A: ONBLOCK_DT_A ?? this.ONBLOCK_DT_A,
  648. OFFBLOCK_DT_F: OFFBLOCK_DT_F ?? this.OFFBLOCK_DT_F,
  649. AIRBORNE_DT_F: AIRBORNE_DT_F ?? this.AIRBORNE_DT_F,
  650. LANDING_DT_F: LANDING_DT_F ?? this.LANDING_DT_F,
  651. ONBLOCK_DT_F: ONBLOCK_DT_F ?? this.ONBLOCK_DT_F,
  652. OFFBLOCK_DT_M: OFFBLOCK_DT_M ?? this.OFFBLOCK_DT_M,
  653. AIRBORNE_DT_M: AIRBORNE_DT_M ?? this.AIRBORNE_DT_M,
  654. LANDING_DT_M: LANDING_DT_M ?? this.LANDING_DT_M,
  655. ONBLOCK_DT_M: ONBLOCK_DT_M ?? this.ONBLOCK_DT_M,
  656. EET: EET ?? this.EET,
  657. );
  658. }
  659. Map<String, dynamic> toMap() {
  660. return <String, dynamic>{
  661. 'LEG_NO': LEG_NO,
  662. 'FN_CARRIER': FN_CARRIER,
  663. 'FN_NUMBER': FN_NUMBER,
  664. 'FN_SUFFIX': FN_SUFFIX,
  665. 'DAY_OF_ORIGIN': DAY_OF_ORIGIN,
  666. 'AC_OWNER': AC_OWNER,
  667. 'AC_SUBTYPE': AC_SUBTYPE,
  668. 'AC_VERSION': AC_VERSION,
  669. 'AC_REGISTRATION': AC_REGISTRATION,
  670. 'DEP_AP_ACTUAL': DEP_AP_ACTUAL,
  671. 'DEP_AP_SCHED': DEP_AP_SCHED,
  672. 'DEP_DT_EST': DEP_DT_EST,
  673. 'DEP_SCHED_DT': DEP_SCHED_DT,
  674. 'ARR_AP_ACTUAL': ARR_AP_ACTUAL,
  675. 'ARR_AP_SCHED': ARR_AP_SCHED,
  676. 'ARR_DT_EST': ARR_DT_EST,
  677. 'ARR_SCHED_DT': ARR_SCHED_DT,
  678. 'SLOT_TIME_ACTUAL': SLOT_TIME_ACTUAL,
  679. 'LEG_TYPE': LEG_TYPE,
  680. 'STATUS': STATUS,
  681. 'EMPLOYER_COCKPIT': EMPLOYER_COCKPIT,
  682. 'EMPLOYER_CABIN': EMPLOYER_CABIN,
  683. 'CYCLES': CYCLES,
  684. 'DELAY_CODE_01': DELAY_CODE_01,
  685. 'DELAY_CODE_02': DELAY_CODE_02,
  686. 'DELAY_CODE_03': DELAY_CODE_03,
  687. 'DELAY_CODE_04': DELAY_CODE_04,
  688. 'DELAY_TIME_01': DELAY_TIME_01,
  689. 'DELAY_TIME_02': DELAY_TIME_02,
  690. 'DELAY_TIME_03': DELAY_TIME_03,
  691. 'DELAY_TIME_04': DELAY_TIME_04,
  692. 'SUBDELAY_CODE_01': SUBDELAY_CODE_01,
  693. 'SUBDELAY_CODE_02': SUBDELAY_CODE_02,
  694. 'SUBDELAY_CODE_03': SUBDELAY_CODE_03,
  695. 'SUBDELAY_CODE_04': SUBDELAY_CODE_04,
  696. 'PAX_BOOKED_C': PAX_BOOKED_C,
  697. 'PAX_BOOKED_Y': PAX_BOOKED_Y,
  698. 'PAX_BOOKED_TRS_C': PAX_BOOKED_TRS_C,
  699. 'PAX_BOOKED_TRS_Y': PAX_BOOKED_TRS_Y,
  700. 'PAD_BOOKED_C': PAD_BOOKED_C,
  701. 'PAD_BOOKED_Y': PAD_BOOKED_Y,
  702. 'OFFBLOCK_DT_A': OFFBLOCK_DT_A,
  703. 'AIRBORNE_DT_A': AIRBORNE_DT_A,
  704. 'LANDING_DT_A': LANDING_DT_A,
  705. 'ONBLOCK_DT_A': ONBLOCK_DT_A,
  706. 'OFFBLOCK_DT_F': OFFBLOCK_DT_F,
  707. 'AIRBORNE_DT_F': AIRBORNE_DT_F,
  708. 'LANDING_DT_F': LANDING_DT_F,
  709. 'ONBLOCK_DT_F': ONBLOCK_DT_F,
  710. 'OFFBLOCK_DT_M': OFFBLOCK_DT_M,
  711. 'AIRBORNE_DT_M': AIRBORNE_DT_M,
  712. 'LANDING_DT_M': LANDING_DT_M,
  713. 'ONBLOCK_DT_M': ONBLOCK_DT_M,
  714. 'EET': EET,
  715. };
  716. }
  717. factory Acleg.fromList(List datalist) {
  718. //print(datalist);
  719. if (datalist.length >= 54) {
  720. return Acleg(
  721. LEG_NO: datalist[0],
  722. FN_CARRIER: datalist[1],
  723. FN_NUMBER: datalist[2],
  724. FN_SUFFIX: datalist[3],
  725. DAY_OF_ORIGIN: datalist[4],
  726. AC_OWNER: datalist[5],
  727. AC_SUBTYPE: datalist[6],
  728. AC_VERSION: datalist[7],
  729. AC_REGISTRATION: datalist[8],
  730. DEP_AP_ACTUAL: datalist[9],
  731. DEP_AP_SCHED: datalist[10],
  732. DEP_DT_EST: datalist[11],
  733. DEP_SCHED_DT: datalist[12],
  734. ARR_AP_ACTUAL: datalist[13],
  735. ARR_AP_SCHED: datalist[14],
  736. ARR_DT_EST: datalist[15],
  737. ARR_SCHED_DT: datalist[16],
  738. SLOT_TIME_ACTUAL: datalist[17],
  739. LEG_TYPE: datalist[18],
  740. STATUS: datalist[19],
  741. EMPLOYER_COCKPIT: datalist[20],
  742. EMPLOYER_CABIN: datalist[21],
  743. CYCLES: datalist[22],
  744. DELAY_CODE_01: datalist[23],
  745. DELAY_CODE_02: datalist[24],
  746. DELAY_CODE_03: datalist[25],
  747. DELAY_CODE_04: datalist[26],
  748. DELAY_TIME_01: datalist[27],
  749. DELAY_TIME_02: datalist[28],
  750. DELAY_TIME_03: datalist[29],
  751. DELAY_TIME_04: datalist[30],
  752. SUBDELAY_CODE_01: datalist[31],
  753. SUBDELAY_CODE_02: datalist[32],
  754. SUBDELAY_CODE_03: datalist[33],
  755. SUBDELAY_CODE_04: datalist[34],
  756. PAX_BOOKED_C: datalist[35],
  757. PAX_BOOKED_Y: datalist[36],
  758. PAX_BOOKED_TRS_C: datalist[37],
  759. PAX_BOOKED_TRS_Y: datalist[38],
  760. PAD_BOOKED_C: datalist[39],
  761. PAD_BOOKED_Y: datalist[40],
  762. OFFBLOCK_DT_A: datalist[41],
  763. AIRBORNE_DT_A: datalist[42],
  764. LANDING_DT_A: datalist[43],
  765. ONBLOCK_DT_A: datalist[44],
  766. OFFBLOCK_DT_F: datalist[45],
  767. AIRBORNE_DT_F: datalist[46],
  768. LANDING_DT_F: datalist[47],
  769. ONBLOCK_DT_F: datalist[48],
  770. OFFBLOCK_DT_M: datalist[49],
  771. AIRBORNE_DT_M: datalist[50],
  772. LANDING_DT_M: datalist[51],
  773. ONBLOCK_DT_M: datalist[52],
  774. EET: datalist[53]);
  775. } else {
  776. return Acleg();
  777. }
  778. }
  779. factory Acleg.fromMap(Map<String, dynamic> map) {
  780. return Acleg(
  781. LEG_NO: map['LEG_NO'] != null ? map['LEG_NO'] as String : null,
  782. FN_CARRIER:
  783. map['FN_CARRIER'] != null ? map['FN_CARRIER'] as String : null,
  784. FN_NUMBER: map['FN_NUMBER'] != null ? map['FN_NUMBER'] as String : null,
  785. FN_SUFFIX: map['FN_SUFFIX'] != null ? map['FN_SUFFIX'] as String : null,
  786. DAY_OF_ORIGIN:
  787. map['DAY_OF_ORIGIN'] != null ? map['DAY_OF_ORIGIN'] as String : null,
  788. AC_OWNER: map['AC_OWNER'] != null ? map['AC_OWNER'] as String : null,
  789. AC_SUBTYPE:
  790. map['AC_SUBTYPE'] != null ? map['AC_SUBTYPE'] as String : null,
  791. AC_VERSION:
  792. map['AC_VERSION'] != null ? map['AC_VERSION'] as String : null,
  793. AC_REGISTRATION: map['AC_REGISTRATION'] != null
  794. ? map['AC_REGISTRATION'] as String
  795. : null,
  796. DEP_AP_ACTUAL:
  797. map['DEP_AP_ACTUAL'] != null ? map['DEP_AP_ACTUAL'] as String : null,
  798. DEP_AP_SCHED:
  799. map['DEP_AP_SCHED'] != null ? map['DEP_AP_SCHED'] as String : null,
  800. DEP_DT_EST:
  801. map['DEP_DT_EST'] != null ? map['DEP_DT_EST'] as String : null,
  802. DEP_SCHED_DT:
  803. map['DEP_SCHED_DT'] != null ? map['DEP_SCHED_DT'] as String : null,
  804. ARR_AP_ACTUAL:
  805. map['ARR_AP_ACTUAL'] != null ? map['ARR_AP_ACTUAL'] as String : null,
  806. ARR_AP_SCHED:
  807. map['ARR_AP_SCHED'] != null ? map['ARR_AP_SCHED'] as String : null,
  808. ARR_DT_EST:
  809. map['ARR_DT_EST'] != null ? map['ARR_DT_EST'] as String : null,
  810. ARR_SCHED_DT:
  811. map['ARR_SCHED_DT'] != null ? map['ARR_SCHED_DT'] as String : null,
  812. SLOT_TIME_ACTUAL: map['SLOT_TIME_ACTUAL'] != null
  813. ? map['SLOT_TIME_ACTUAL'] as String
  814. : null,
  815. LEG_TYPE: map['LEG_TYPE'] != null ? map['LEG_TYPE'] as String : null,
  816. EMPLOYER_COCKPIT: map['EMPLOYER_COCKPIT'] != null
  817. ? map['EMPLOYER_COCKPIT'] as String
  818. : null,
  819. EMPLOYER_CABIN: map['EMPLOYER_CABIN'] != null
  820. ? map['EMPLOYER_CABIN'] as String
  821. : null,
  822. // CYCLES: map['CYCLES'] != null ? map['CYCLES'] as String : null,
  823. DELAY_CODE_01:
  824. map['DELAY_CODE_01'] != null ? map['DELAY_CODE_01'] as String : null,
  825. DELAY_CODE_02:
  826. map['DELAY_CODE_02'] != null ? map['DELAY_CODE_02'] as String : null,
  827. DELAY_CODE_03:
  828. map['DELAY_CODE_03'] != null ? map['DELAY_CODE_03'] as String : null,
  829. DELAY_CODE_04:
  830. map['DELAY_CODE_04'] != null ? map['DELAY_CODE_04'] as String : null,
  831. DELAY_TIME_01:
  832. map['DELAY_TIME_01'] != null ? map['DELAY_TIME_01'] as String : null,
  833. DELAY_TIME_02:
  834. map['DELAY_TIME_02'] != null ? map['DELAY_TIME_02'] as String : null,
  835. DELAY_TIME_03:
  836. map['DELAY_TIME_03'] != null ? map['DELAY_TIME_03'] as String : null,
  837. DELAY_TIME_04:
  838. map['DELAY_TIME_04'] != null ? map['DELAY_TIME_04'] as String : null,
  839. SUBDELAY_CODE_01: map['SUBDELAY_CODE_01'] != null
  840. ? map['SUBDELAY_CODE_01'] as String
  841. : null,
  842. SUBDELAY_CODE_02: map['SUBDELAY_CODE_02'] != null
  843. ? map['SUBDELAY_CODE_02'] as String
  844. : null,
  845. SUBDELAY_CODE_03: map['SUBDELAY_CODE_03'] != null
  846. ? map['SUBDELAY_CODE_03'] as String
  847. : null,
  848. SUBDELAY_CODE_04: map['SUBDELAY_CODE_04'] != null
  849. ? map['SUBDELAY_CODE_04'] as String
  850. : null,
  851. PAX_BOOKED_C:
  852. map['PAX_BOOKED_C'] != null ? map['PAX_BOOKED_C'] as String : null,
  853. PAX_BOOKED_Y:
  854. map['PAX_BOOKED_Y'] != null ? map['PAX_BOOKED_Y'] as String : null,
  855. PAX_BOOKED_TRS_C: map['PAX_BOOKED_TRS_C'] != null
  856. ? map['PAX_BOOKED_TRS_C'] as String
  857. : null,
  858. PAX_BOOKED_TRS_Y: map['PAX_BOOKED_TRS_Y'] != null
  859. ? map['PAX_BOOKED_TRS_Y'] as String
  860. : null,
  861. PAD_BOOKED_C:
  862. map['PAD_BOOKED_C'] != null ? map['PAD_BOOKED_C'] as String : null,
  863. PAD_BOOKED_Y:
  864. map['PAD_BOOKED_Y'] != null ? map['PAD_BOOKED_Y'] as String : null,
  865. OFFBLOCK_DT_A:
  866. map['OFFBLOCK_DT_A'] != null ? map['OFFBLOCK_DT_A'] as String : null,
  867. AIRBORNE_DT_A:
  868. map['AIRBORNE_DT_A'] != null ? map['AIRBORNE_DT_A'] as String : null,
  869. LANDING_DT_A:
  870. map['LANDING_DT_A'] != null ? map['LANDING_DT_A'] as String : null,
  871. ONBLOCK_DT_A:
  872. map['ONBLOCK_DT_A'] != null ? map['ONBLOCK_DT_A'] as String : null,
  873. OFFBLOCK_DT_F:
  874. map['OFFBLOCK_DT_F'] != null ? map['OFFBLOCK_DT_F'] as String : null,
  875. AIRBORNE_DT_F:
  876. map['AIRBORNE_DT_F'] != null ? map['AIRBORNE_DT_F'] as String : null,
  877. LANDING_DT_F:
  878. map['LANDING_DT_F'] != null ? map['LANDING_DT_F'] as String : null,
  879. ONBLOCK_DT_F:
  880. map['ONBLOCK_DT_F'] != null ? map['ONBLOCK_DT_F'] as String : null,
  881. OFFBLOCK_DT_M:
  882. map['OFFBLOCK_DT_M'] != null ? map['OFFBLOCK_DT_M'] as String : null,
  883. AIRBORNE_DT_M:
  884. map['AIRBORNE_DT_M'] != null ? map['AIRBORNE_DT_M'] as String : null,
  885. LANDING_DT_M:
  886. map['LANDING_DT_M'] != null ? map['LANDING_DT_M'] as String : null,
  887. ONBLOCK_DT_M:
  888. map['ONBLOCK_DT_M'] != null ? map['ONBLOCK_DT_M'] as String : null,
  889. EET: map['EET'] != null ? map['EET'] as String : null,
  890. );
  891. }
  892. String toJson() => json.encode(toMap());
  893. factory Acleg.fromJson(String source) =>
  894. Acleg.fromMap(json.decode(source) as Map<String, dynamic>);
  895. @override
  896. String toString() {
  897. return 'Acleg(LEG_NO: $LEG_NO, FN_CARRIER: $FN_CARRIER, FN_NUMBER: $FN_NUMBER, FN_SUFFIX: $FN_SUFFIX, DAY_OF_ORIGIN: $DAY_OF_ORIGIN, AC_OWNER: $AC_OWNER, AC_SUBTYPE: $AC_SUBTYPE, AC_VERSION: $AC_VERSION, AC_REGISTRATION: $AC_REGISTRATION, DEP_AP_ACTUAL: $DEP_AP_ACTUAL, DEP_AP_SCHED: $DEP_AP_SCHED, DEP_DT_EST: $DEP_DT_EST, DEP_SCHED_DT: $DEP_SCHED_DT, ARR_AP_ACTUAL: $ARR_AP_ACTUAL, ARR_AP_SCHED: $ARR_AP_SCHED, ARR_DT_EST: $ARR_DT_EST, ARR_SCHED_DT: $ARR_SCHED_DT, SLOT_TIME_ACTUAL: $SLOT_TIME_ACTUAL, LEG_TYPE: $LEG_TYPE, EMPLOYER_COCKPIT: $EMPLOYER_COCKPIT, EMPLOYER_CABIN: $EMPLOYER_CABIN, CYCLES: $CYCLES, DELAY_CODE_01: $DELAY_CODE_01, DELAY_CODE_02: $DELAY_CODE_02, DELAY_CODE_03: $DELAY_CODE_03, DELAY_CODE_04: $DELAY_CODE_04, DELAY_TIME_01: $DELAY_TIME_01, DELAY_TIME_02: $DELAY_TIME_02, DELAY_TIME_03: $DELAY_TIME_03, DELAY_TIME_04: $DELAY_TIME_04, SUBDELAY_CODE_01: $SUBDELAY_CODE_01, SUBDELAY_CODE_02: $SUBDELAY_CODE_02, SUBDELAY_CODE_03: $SUBDELAY_CODE_03, SUBDELAY_CODE_04: $SUBDELAY_CODE_04, PAX_BOOKED_C: $PAX_BOOKED_C, PAX_BOOKED_Y: $PAX_BOOKED_Y, PAX_BOOKED_TRS_C: $PAX_BOOKED_TRS_C, PAX_BOOKED_TRS_Y: $PAX_BOOKED_TRS_Y, PAD_BOOKED_C: $PAD_BOOKED_C, PAD_BOOKED_Y: $PAD_BOOKED_Y, OFFBLOCK_DT_A: $OFFBLOCK_DT_A, AIRBORNE_DT_A: $AIRBORNE_DT_A, LANDING_DT_A: $LANDING_DT_A, ONBLOCK_DT_A: $ONBLOCK_DT_A, OFFBLOCK_DT_F: $OFFBLOCK_DT_F, AIRBORNE_DT_F: $AIRBORNE_DT_F, LANDING_DT_F: $LANDING_DT_F, ONBLOCK_DT_F: $ONBLOCK_DT_F, OFFBLOCK_DT_M: $OFFBLOCK_DT_M, AIRBORNE_DT_M: $AIRBORNE_DT_M, LANDING_DT_M: $LANDING_DT_M, ONBLOCK_DT_M: $ONBLOCK_DT_M, EET: $EET)';
  898. }
  899. @override
  900. bool operator ==(covariant Acleg other) {
  901. if (identical(this, other)) return true;
  902. return other.LEG_NO == LEG_NO &&
  903. other.FN_CARRIER == FN_CARRIER &&
  904. other.FN_NUMBER == FN_NUMBER &&
  905. other.FN_SUFFIX == FN_SUFFIX &&
  906. other.DAY_OF_ORIGIN == DAY_OF_ORIGIN &&
  907. other.AC_OWNER == AC_OWNER &&
  908. other.AC_SUBTYPE == AC_SUBTYPE &&
  909. other.AC_VERSION == AC_VERSION &&
  910. other.AC_REGISTRATION == AC_REGISTRATION &&
  911. other.DEP_AP_ACTUAL == DEP_AP_ACTUAL &&
  912. other.DEP_AP_SCHED == DEP_AP_SCHED &&
  913. other.DEP_DT_EST == DEP_DT_EST &&
  914. other.DEP_SCHED_DT == DEP_SCHED_DT &&
  915. other.ARR_AP_ACTUAL == ARR_AP_ACTUAL &&
  916. other.ARR_AP_SCHED == ARR_AP_SCHED &&
  917. other.ARR_DT_EST == ARR_DT_EST &&
  918. other.ARR_SCHED_DT == ARR_SCHED_DT &&
  919. other.SLOT_TIME_ACTUAL == SLOT_TIME_ACTUAL &&
  920. other.LEG_TYPE == LEG_TYPE &&
  921. other.EMPLOYER_COCKPIT == EMPLOYER_COCKPIT &&
  922. other.EMPLOYER_CABIN == EMPLOYER_CABIN &&
  923. other.CYCLES == CYCLES &&
  924. other.DELAY_CODE_01 == DELAY_CODE_01 &&
  925. other.DELAY_CODE_02 == DELAY_CODE_02 &&
  926. other.DELAY_CODE_03 == DELAY_CODE_03 &&
  927. other.DELAY_CODE_04 == DELAY_CODE_04 &&
  928. other.DELAY_TIME_01 == DELAY_TIME_01 &&
  929. other.DELAY_TIME_02 == DELAY_TIME_02 &&
  930. other.DELAY_TIME_03 == DELAY_TIME_03 &&
  931. other.DELAY_TIME_04 == DELAY_TIME_04 &&
  932. other.SUBDELAY_CODE_01 == SUBDELAY_CODE_01 &&
  933. other.SUBDELAY_CODE_02 == SUBDELAY_CODE_02 &&
  934. other.SUBDELAY_CODE_03 == SUBDELAY_CODE_03 &&
  935. other.SUBDELAY_CODE_04 == SUBDELAY_CODE_04 &&
  936. other.PAX_BOOKED_C == PAX_BOOKED_C &&
  937. other.PAX_BOOKED_Y == PAX_BOOKED_Y &&
  938. other.PAX_BOOKED_TRS_C == PAX_BOOKED_TRS_C &&
  939. other.PAX_BOOKED_TRS_Y == PAX_BOOKED_TRS_Y &&
  940. other.PAD_BOOKED_C == PAD_BOOKED_C &&
  941. other.PAD_BOOKED_Y == PAD_BOOKED_Y &&
  942. other.OFFBLOCK_DT_A == OFFBLOCK_DT_A &&
  943. other.AIRBORNE_DT_A == AIRBORNE_DT_A &&
  944. other.LANDING_DT_A == LANDING_DT_A &&
  945. other.ONBLOCK_DT_A == ONBLOCK_DT_A &&
  946. other.OFFBLOCK_DT_F == OFFBLOCK_DT_F &&
  947. other.AIRBORNE_DT_F == AIRBORNE_DT_F &&
  948. other.LANDING_DT_F == LANDING_DT_F &&
  949. other.ONBLOCK_DT_F == ONBLOCK_DT_F &&
  950. other.OFFBLOCK_DT_M == OFFBLOCK_DT_M &&
  951. other.AIRBORNE_DT_M == AIRBORNE_DT_M &&
  952. other.LANDING_DT_M == LANDING_DT_M &&
  953. other.ONBLOCK_DT_M == ONBLOCK_DT_M &&
  954. other.EET == EET;
  955. }
  956. @override
  957. int get hashCode {
  958. return LEG_NO.hashCode ^
  959. FN_CARRIER.hashCode ^
  960. FN_NUMBER.hashCode ^
  961. FN_SUFFIX.hashCode ^
  962. DAY_OF_ORIGIN.hashCode ^
  963. AC_OWNER.hashCode ^
  964. AC_SUBTYPE.hashCode ^
  965. AC_VERSION.hashCode ^
  966. AC_REGISTRATION.hashCode ^
  967. DEP_AP_ACTUAL.hashCode ^
  968. DEP_AP_SCHED.hashCode ^
  969. DEP_DT_EST.hashCode ^
  970. DEP_SCHED_DT.hashCode ^
  971. ARR_AP_ACTUAL.hashCode ^
  972. ARR_AP_SCHED.hashCode ^
  973. ARR_DT_EST.hashCode ^
  974. ARR_SCHED_DT.hashCode ^
  975. SLOT_TIME_ACTUAL.hashCode ^
  976. LEG_TYPE.hashCode ^
  977. EMPLOYER_COCKPIT.hashCode ^
  978. EMPLOYER_CABIN.hashCode ^
  979. CYCLES.hashCode ^
  980. DELAY_CODE_01.hashCode ^
  981. DELAY_CODE_02.hashCode ^
  982. DELAY_CODE_03.hashCode ^
  983. DELAY_CODE_04.hashCode ^
  984. DELAY_TIME_01.hashCode ^
  985. DELAY_TIME_02.hashCode ^
  986. DELAY_TIME_03.hashCode ^
  987. DELAY_TIME_04.hashCode ^
  988. SUBDELAY_CODE_01.hashCode ^
  989. SUBDELAY_CODE_02.hashCode ^
  990. SUBDELAY_CODE_03.hashCode ^
  991. SUBDELAY_CODE_04.hashCode ^
  992. PAX_BOOKED_C.hashCode ^
  993. PAX_BOOKED_Y.hashCode ^
  994. PAX_BOOKED_TRS_C.hashCode ^
  995. PAX_BOOKED_TRS_Y.hashCode ^
  996. PAD_BOOKED_C.hashCode ^
  997. PAD_BOOKED_Y.hashCode ^
  998. OFFBLOCK_DT_A.hashCode ^
  999. AIRBORNE_DT_A.hashCode ^
  1000. LANDING_DT_A.hashCode ^
  1001. ONBLOCK_DT_A.hashCode ^
  1002. OFFBLOCK_DT_F.hashCode ^
  1003. AIRBORNE_DT_F.hashCode ^
  1004. LANDING_DT_F.hashCode ^
  1005. ONBLOCK_DT_F.hashCode ^
  1006. OFFBLOCK_DT_M.hashCode ^
  1007. AIRBORNE_DT_M.hashCode ^
  1008. LANDING_DT_M.hashCode ^
  1009. ONBLOCK_DT_M.hashCode ^
  1010. EET.hashCode;
  1011. }
  1012. }
  1013. extension StringExtensions on String {
  1014. String capitalize() {
  1015. if (isEmpty) {
  1016. return this;
  1017. } else {
  1018. return "${this[0].toUpperCase()}${substring(1).toLowerCase()}";
  1019. }
  1020. }
  1021. String capitalizeword() {
  1022. return split(' ').map((word) => word.capitalize()).join(' ');
  1023. }
  1024. Jiffy? parseddmmyyyyhhmm() => length >= 15
  1025. ? Jiffy.parse(
  1026. "${substring(6, 10)}-${substring(3, 5)}-${substring(0, 2)} ${substring(11, 13)}:${substring(13, 15)}",
  1027. pattern: 'yyyy-MM-dd HH:mm',
  1028. isUtc: true)
  1029. : null;
  1030. Jiffy? parseyyyymmddhhmm() => length >= 16
  1031. ? Jiffy.parse(this,
  1032. pattern: 'yyyy-MM-dd HH:mm:ss',
  1033. // "${substring(6, 10)}-${substring(3, 5)}-${substring(0, 2)} ${substring(11, 13)}${substring(13, 16)}",
  1034. // pattern: 'yyyy-MM-dd HH:mm',
  1035. isUtc: true)
  1036. : null;
  1037. }