ticketDetailsSection method

Column ticketDetailsSection()

Implementation

Column ticketDetailsSection() {
  return Column(
    children: [
      16.dp.SpaceX,
      Row(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Text(
            'Booking Reference',
            style: TextStyle(
              fontSize: 14.dp,
              fontWeight: FontWeight.w400,
              color: ColorHelper.neutralLightText,
            ),
          ),
          20.dp.SpaceY,
          Expanded(
            child: Row(
              mainAxisAlignment: MainAxisAlignment.end,
              children: [
                Text(
                  history.bookingReference ?? '',
                  textAlign: TextAlign.end,
                  style: TextStyle(
                    fontSize: 14.dp,
                    fontWeight: FontWeight.w500,
                    color: ColorHelper.neutralMediumText,
                  ),
                ),
                10.SpaceY,
                 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),
                    ),
                 ),
              ],
            ),
          ),
        ],
      ),
      14.dp.SpaceX,
      Row(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Text(
            'Miles Earned',
            style: TextStyle(
              fontSize: 14.dp,
              fontWeight: FontWeight.w400,
              color: ColorHelper.neutralLightText,
            ),
          ),
          20.dp.SpaceY,
          Expanded(
            child: Text(
              history.milesEarned != null
                  ? history.milesEarned.toString()
                  : '0',
              textAlign: TextAlign.end,
              style: TextStyle(
                fontSize: 14.dp,
                fontWeight: FontWeight.w500,
                color: ColorHelper.neutralMediumText,
              ),
            ),
          ),
        ],
      ),
      if(!history.isNonDiscounted)...{
        14.dp.SpaceX,
        Row(
          crossAxisAlignment: CrossAxisAlignment.start,
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Text(
              'Actions',
              style: TextStyle(
                fontSize: 14.dp,
                fontWeight: FontWeight.w400,
                color: ColorHelper.neutralLightText,
              ),
            ),
            _buildDownloadButton(),
          ],
        ),
      },
      if(history.bookingStatus == BookingStatus.paid || history.bookingStatus == BookingStatus.bookingConfirmed)...{
        14.dp.SpaceX,
        Row(
          crossAxisAlignment: CrossAxisAlignment.start,
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Text(
              '',
              style: TextStyle(
                fontSize: 14.dp,
                fontWeight: FontWeight.w400,
                color: ColorHelper.neutralLightText,
              ),
            ),
            _downloadInvoiceButton(),
          ],
        ),
      },
    ],
  );
}