mobileHeaderRow method

Widget mobileHeaderRow(
  1. FromAirport? fromAirport,
  2. FromAirport? toAirport,
  3. Color color,
  4. double nameFontSize,
  5. FontWeight nameFontWeight,
  6. bool changeTrailingButton,
)

Implementation

Widget mobileHeaderRow(FromAirport? fromAirport, FromAirport? toAirport, Color color, double nameFontSize, FontWeight nameFontWeight, bool changeTrailingButton) {
  return Column(
    mainAxisAlignment: MainAxisAlignment.start,
    mainAxisSize: MainAxisSize.min,
    crossAxisAlignment: CrossAxisAlignment.center,
    children: [
      Wrap(
        alignment: WrapAlignment.start,
        crossAxisAlignment: WrapCrossAlignment.center,
        runSpacing: 10,
        children: [
          Image.asset('assets/myflights/plane.png', color: ColorHelper.primaryColor1),
          13.dp.SpaceY,
          RichText(
            overflow: TextOverflow.ellipsis,
            text: TextSpan(
                style: TextStyle(
                  fontSize: 18.dp,
                  fontWeight: FontWeight.w600,
                  color: color,
                ),
                children: [
                  // if(changeTrailingButton)
                  TextSpan(text: '${fromAirport?.code ?? ''} -'),
                  TextSpan(
                    text: ' ${fromAirport?.municipality ?? "--"}',
                    style: TextStyle(
                      fontSize: nameFontSize,
                      fontWeight: nameFontWeight,
                      color: color,
                    ),
                  )
                ]),
          ),
          6.dp.SpaceY,
          FlightSearchUtils.mapTripType(history.tripType ?? '') ==
                  TripType.oneWay
              ? Image.asset('assets/myflights/arrow.png', color: ColorHelper.primaryColor1)
              : Padding(
                  padding: const EdgeInsets.only(left: 5, right: 5),
                  child: SvgPicture.asset('assets/myflights/round_trip.svg', colorFilter: const ColorFilter.mode(ColorHelper.primaryColor1, BlendMode.srcIn),)),
          6.dp.SpaceY,
          RichText(
            overflow: TextOverflow.ellipsis,
            text: TextSpan(
                style: TextStyle(
                  fontSize: 18.dp,
                  fontWeight: FontWeight.w600,
                  color: color,
                ),
                children: [
                  // if(changeTrailingButton)
                  TextSpan(text: '${toAirport?.code ?? ''} -'),
                  TextSpan(
                    text: ' ${toAirport?.municipality ?? "--"}',
                    style: TextStyle(
                      fontSize: nameFontSize,
                      fontWeight: nameFontWeight,
                      color: color,
                    ),
                  )
                ]),
          ),
        ],
      ),
      // SizedBox(
      //   width: double.infinity,
      //   child: Wrap(
      //     alignment: WrapAlignment.spaceBetween,
      //     crossAxisAlignment: WrapCrossAlignment.center,
      //     children: [
      //       Container(
      //         margin: const EdgeInsets.only(top: 5),
      //         padding:
      //             const EdgeInsets.symmetric(vertical: 4, horizontal: 12),
      //         // width: 103,
      //         height: 28,
      //         decoration: BoxDecoration(
      //           color: FlightUtils.mapBookingStatus(history.status!)
      //               .backgroundColor,
      //           borderRadius: BorderRadius.circular(32),
      //         ),
      //         child: Row(
      //           mainAxisSize: MainAxisSize.min,
      //           mainAxisAlignment: MainAxisAlignment.spaceBetween,
      //           children: [
      //             Image.asset('assets/myflights/circle.png',
      //                 color: FlightUtils.mapBookingStatus(history.status!)
      //                     .textColor),
      //             7.dp.SpaceY,
      //             Text(
      //               FlightUtils.mapBookingStatus(history.status!)
      //                       .valueWithoutHyphens
      //                       .capitalize ??
      //                   'Unknown',
      //               style: TextStyle(
      //                 fontSize: 12.dp,
      //                 fontWeight: FontWeight.w500,
      //                 color: FlightUtils.mapBookingStatus(history.status!)
      //                     .textColor,
      //               ),
      //             ),
      //           ],
      //         ),
      //       ),
      //       changeTrailingButton
      //           ? InkWell(
      //               onTap: onTap,
      //               child: Text(
      //                 'View Details',
      //                 textAlign: TextAlign.center,
      //                 overflow: TextOverflow.ellipsis,
      //                 maxLines: 1,
      //                 style: TextStyle(
      //                   fontSize: 14.dp,
      //                   fontWeight: FontWeight.w500,
      //                   color: ColorHelper.primaryBlue,
      //                 ),
      //               ),
      //             )
      //           : Padding(
      //               padding: const EdgeInsets.only(top: 5),
      //               child: InkWell(
      //                 onTap: onTap,
      //                 child: Row(
      //                   mainAxisSize: MainAxisSize.min,
      //                   children: [
      //                     Text(
      //                       'View Details',
      //                       overflow: TextOverflow.ellipsis,
      //                       maxLines: 1,
      //                       style: TextStyle(
      //                         fontSize: 14.dp,
      //                         fontWeight: FontWeight.w500,
      //                         color: ColorHelper.primaryBlue,
      //                       ),
      //                     ),
      //                     4.dp.SpaceY,
      //                     Image.asset(icon),
      //                   ],
      //                 ),
      //               ),
      //             ),
      //     ],
      //   ),
      // )
    ],
  );
}