ticketDetailsTable method

Table ticketDetailsTable()

Implementation

Table ticketDetailsTable() {
  return Table(
    border: const TableBorder(
      horizontalInside: BorderSide(
        width: 0.5,
        color: ColorHelper.grey01,
      ),
    ),
    defaultVerticalAlignment: TableCellVerticalAlignment.middle,
    children: [
      TableRow(
        children: [
          tableLabel('Booking Reference'),
          tableLabel('Miles Earned'),
          if(!history.isNonDiscounted)...{
            tableLabel('Actions'),
          },
          if (history.bookingStatus == BookingStatus.paid || history.bookingStatus == BookingStatus.bookingConfirmed)
            tableLabel(''),
        ],
      ),
      ...List.generate((1), (index) {
        return TableRow(
          decoration: const BoxDecoration(
            color: ColorHelper.background,
          ),
          children: [
            buildTableCell(history.bookingReference ?? '', optional:
                 InkWell(
                  onTap: () async {
                     await Clipboard.setData(
                        ClipboardData(text: history.bookingReference ?? ''),
                      );
                      CustomFlashWidget.showFlashMessage(
                        type: FlashType.success,
                        title: "Success",
                        message: "Copied to clipboard",
                      );
                  },
                   child: SvgPicture.asset(
                      'assets/profile/ic_copy.svg',
                      width: 16,
                      height: 16,
                      colorFilter: const ColorFilter.mode(
                        ColorHelper.neutralMediumText, BlendMode.srcIn),
                    ),
                 ),),
            buildTableCell(history.milesEarned != null
                ? history.milesEarned.toString()
                : '0'),
            if(!history.isNonDiscounted)...{
              TableCell(
                  child: Padding(
                      padding: const EdgeInsets.fromLTRB(8, 0, 4, 0),
                      child: _buildDownloadButton()))
            },
            if (history.bookingStatus == BookingStatus.paid || history.bookingStatus == BookingStatus.bookingConfirmed)
              TableCell(
                child: Padding(
                  padding: const EdgeInsets.fromLTRB(8, 0, 4, 0),
                  child: _downloadInvoiceButton(),
                ),
              ),
          ],
        );
      }),
    ],
  );
}