| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- import 'package:flutter/material.dart';
- import 'package:gap/gap.dart';
- import 'package:jiffy/jiffy.dart';
- import 'package:tp5/core/core.dart';
- import 'package:tp5/roster/models/crewlist_leg.dart';
- import 'package:tp5/roster/widgets/w_citypair.dart';
- import 'package:tp5/roster/widgets/w_fnum.dart';
- import 'package:tp5/roster/widgets/w_hour.dart';
- class WCrewlist extends StatelessWidget {
- const WCrewlist({super.key, required this.leg, this.date, this.onTap});
- final CrewlistLeg leg;
- final String? date;
- final dynamic onTap;
- @override
- Widget build(BuildContext context) {
- return Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- width: 120,
- color: Colors.grey[900],
- child: Column(
- children: [
- Card(
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(6.0),
- ),
- elevation: 8.0,
- margin:
- const EdgeInsets.symmetric(horizontal: 5.0, vertical: 3.0),
- child: Column(children: [
- Row(
- mainAxisSize: MainAxisSize.max,
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- const Gap(2),
- WHour(jiffy: leg.jdep),
- const Gap(20),
- WHour(
- jiffy: leg.jdes,
- color: leg.jdes.format(pattern: "yyyy-MM-dd") ==
- leg.date
- ? null
- : Colors.yellow[800]),
- const Gap(2),
- ]),
- Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [WCitypair(iata1: leg.dep, iata2: leg.des)],
- ),
- WFnum(al: leg.al, fnum: leg.fnum),
- ]),
- ),
- Text(
- Jiffy.parse(leg.date, pattern: "yyyy-MM-dd", isUtc: true)
- .format(pattern: "EEE dd MMM'yy"),
- style: const TextStyle(
- fontSize: 10,
- color: Colors.blueGrey,
- letterSpacing: 2,
- fontWeight: FontWeight.w700))
- ],
- ),
- ),
- const Gap(5),
- Container(
- width: 130,
- color: Colors.grey[900],
- child:
- Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- const Gap(20),
- const Text(
- "<Cockpit>",
- style:
- TextStyle(fontWeight: FontWeight.w600, letterSpacing: 2),
- ),
- Text("${leg.cockpit.length}",
- style: const TextStyle(
- fontWeight: FontWeight.w900, color: Colors.amber)),
- ],
- ),
- const Gap(5),
- ...leg.cockpit.map(
- (e) => Text(
- "+ ${e.capitalizeword()}",
- overflow: TextOverflow.ellipsis,
- style: const TextStyle(fontSize: 12),
- ),
- ),
- const Gap(10)
- ]),
- ),
- const Gap(5),
- Container(
- width: 130,
- color: Colors.grey[900],
- child:
- Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- const Gap(20),
- const Text(
- "<Cabin>",
- style:
- TextStyle(fontWeight: FontWeight.w600, letterSpacing: 2),
- ),
- Text("${leg.cabin.length}",
- style: const TextStyle(
- fontWeight: FontWeight.w900, color: Colors.amber)),
- ],
- ),
- const Gap(5),
- ...leg.cabin.map(
- (e) => Text(
- "+ ${e.capitalizeword()}",
- overflow: TextOverflow.ellipsis,
- style: const TextStyle(fontSize: 12),
- ),
- ),
- const Gap(10)
- ]),
- ),
- const Gap(5),
- Container(
- width: 130,
- color: Colors.grey[900],
- child:
- Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- const Gap(20),
- const Text(
- "<DH>",
- style:
- TextStyle(fontWeight: FontWeight.w600, letterSpacing: 2),
- ),
- Text("${leg.dh.length}",
- style: const TextStyle(
- fontWeight: FontWeight.w900, color: Colors.amber)),
- ],
- ),
- const Gap(5),
- ...leg.dh.map(
- (e) => Text(
- "+ ${e.capitalizeword()}",
- overflow: TextOverflow.ellipsis,
- style: const TextStyle(fontSize: 12),
- ),
- ),
- const Gap(10)
- ]),
- )
- ],
- );
- }
- // Widget _text(String? msg) => Flexible(
- // child: Tooltip(
- // message: msg ?? "",
- // child: Text(msg ?? "",
- // overflow: TextOverflow.ellipsis,
- // style: const TextStyle(color: Colors.white38, fontSize: 12))));
- }
|