build method

  1. @override
Widget build(
  1. BuildContext context
)
override

Describes the part of the user interface represented by this widget.

The framework calls this method when this widget is inserted into the tree in a given BuildContext and when the dependencies of this widget change (e.g., an InheritedWidget referenced by this widget changes). This method can potentially be called in every frame and should not have any side effects beyond building a widget.

The framework replaces the subtree below this widget with the widget returned by this method, either by updating the existing subtree or by removing the subtree and inflating a new subtree, depending on whether the widget returned by this method can update the root of the existing subtree, as determined by calling Widget.canUpdate.

Typically implementations return a newly created constellation of widgets that are configured with information from this widget's constructor and from the given BuildContext.

The given BuildContext contains information about the location in the tree at which this widget is being built. For example, the context provides the set of inherited widgets for this location in the tree. A given widget might be built with multiple different BuildContext arguments over time if the widget is moved around the tree or if the widget is inserted into the tree in multiple places at once.

The implementation of this method must only depend on:

If a widget's build method is to depend on anything else, use a StatefulWidget instead.

See also:

  • StatelessWidget, which contains the discussion on performance considerations.

Implementation

@override
Widget build(BuildContext context) {
  final controller = Get.find<NeoDashboardController>();
  controller.getUpComingFlights();
  final authController = Get.find<AuthenticationController>();
  final numberFormat = NumberFormat('#,##0.00');

  return ConstrainedBox(
    constraints: context.x > 1100
        ? const BoxConstraints(maxWidth: 1100)
        : BoxConstraints(maxWidth: context.x),
    child: Padding(
      padding: EdgeInsets.symmetric(horizontal: context.x < 1100 ? 12 : 0),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          const ExpiredBanner(),
          ResponsiveGridRow(
            children: [
              ResponsiveGridCol(
                lg: context.x < 1250 ? 6 : 3,
                md: 6,
                child: Container(
                  width: 353.dp,
                  height: 230.dp,
                  // margin: EdgeInsets.only(left: context.x<768?0: 20),
                  alignment: Alignment.topCenter,
                  decoration: BoxDecoration(
                    color: ColorHelper.lightBackground3,
                    borderRadius: BorderRadius.circular(16),
                  ),
                  child: Column(
                    children: [
                      Container(
                        padding: const EdgeInsets.all(16),
                        height: 190.dp,
                        decoration: BoxDecoration(
                          color: Colors.white,
                          borderRadius: BorderRadius.circular(16),
                          border: Border.all(
                              color: ColorHelper.flightDividerColor,
                              width: 0.5),
                        ),
                        child: Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            Row(
                              mainAxisAlignment:
                                  MainAxisAlignment.spaceBetween,
                              children: [
                                SvgPicture.asset(
                                    'assets/dashboard/planee.svg'),
                                Obx(() => Container(
                                  padding: const EdgeInsets.symmetric(
                                      horizontal: 12, vertical: 4),
                                  // width: 69.dp,
                                  height: 28.dp,
                                  decoration: BoxDecoration(
                                    borderRadius: BorderRadius.circular(16),
                                    border: Border.all(
                                        color: ColorHelper.flightDividerColor, width: 0.5),
                                  ),
                                  child: DropdownButtonHideUnderline(
                                    child: DropdownButton<String>(
                                      value: controller.flightFilterType.value,
                                      icon: Padding(
                                        padding: const EdgeInsets.only(left: 8),
                                        child: SvgPicture.asset('assets/dashboard/dropdown.svg'),
                                      ),
                                      style: const TextStyle(
                                        fontSize: 12,
                                        fontWeight: FontWeight.w400,
                                        color: ColorHelper.textDark,
                                      ),
                                      onChanged: (String? newValue) {
                                        if (newValue != null) {
                                          if(controller.flightFilterType.value!=newValue){
                                            controller.getBookingStats(newValue, 'flights');
                                          }
                                          controller.flightFilterType.value = newValue;
                                        }
                                      },
                                      items: [
                                        DropdownMenuItem(
                                          value: 'daily',
                                          child: Text('Daily',style: TextStyle(
                                                                    fontSize: 12.dp,
                                                                    fontWeight: FontWeight.w400,
                                                                    color: ColorHelper.textDark,
                                                                  ),),
                                        ),
                                        DropdownMenuItem(
                                          value: 'weekly',
                                          child: Text('Weekly',style: TextStyle(
                                                                    fontSize: 12.dp,
                                                                    fontWeight: FontWeight.w400,
                                                                    color: ColorHelper.textDark,
                                                                  ),),
                                        ),
                                        DropdownMenuItem(
                                          value: 'monthly',
                                          child: Text('Monthly',style: TextStyle(
                                                                    fontSize: 12.dp,
                                                                    fontWeight: FontWeight.w400,
                                                                    color: ColorHelper.textDark,
                                                                  ),),
                                        ),
                                        DropdownMenuItem(
                                          value: 'yearly',
                                          child: Text('Yearly',style: TextStyle(
                                                                    fontSize: 12.dp,
                                                                    fontWeight: FontWeight.w400,
                                                                    color: ColorHelper.textDark,
                                                                  ),),
                                        ),
                                      ],
                                    ),
                                  ),
                                ))
                              ],
                            ),
                            const SizedBox(
                              height: 28,
                            ),
                            Text(
                              'Total Flights Booked',
                              style: TextStyle(
                                fontSize: 16.dp,
                                fontWeight: FontWeight.w400,
                                color: ColorHelper.textLight,
                              ),
                            ),
                            const SizedBox(
                              height: 6,
                            ),
                            Obx(
                              () {
                                return Text(
                                  (controller.flightsStats.value?.totalBookings??0).toString(),
                                  style: TextStyle(
                                    fontSize: 28.dp,
                                    fontWeight: FontWeight.w700,
                                    color: ColorHelper.textDark,
                                  ),
                                );
                              }
                            ),
                            const SizedBox(
                              height: 12,
                            ),
                            Row(
                              children: [
                                SvgPicture.asset(
                                    'assets/dashboard/upArrow.svg'),
                                const SizedBox(
                                  width: 2,
                                ),
                                Obx(
                                  () {
                                    return Text(
                                      '${(controller.flightsStats.value?.bookingsPercentageChange??0.0).toStringAsFixed(2)}% from last month',
                                      style: TextStyle(
                                        fontSize: 12.dp,
                                        fontWeight: FontWeight.w500,
                                        color: ColorHelper.primaryColor1,
                                      ),
                                    );
                                  }
                                ),
                              ],
                            ),
                          ],
                        ),
                      ),
                      const SizedBox(
                        height: 11,
                      ),
                      const Padding(
                        padding: EdgeInsets.symmetric(horizontal: 14),
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            // Text(
                            //   'Total Distance Covered',
                            //   style: TextStyle(
                            //     fontSize: 12.dp,
                            //     fontWeight: FontWeight.w400,
                            //     color: ColorHelper.textLight,
                            //   ),
                            // ),
                            // Text(
                            //   '0 KM',
                            //   style: TextStyle(
                            //     fontSize: 12.dp,
                            //     fontWeight: FontWeight.w400,
                            //     color: ColorHelper.primaryColor1,
                            //   ),
                            // ),
                          ],
                        ),
                      ),
                    ],
                  ),
                ),
              ),
              ResponsiveGridCol(
                lg: context.x < 1250 ? 6 : 3,
                md: 6,
                child: Container(
                  width: 353.dp,
                  height: 230.dp,
                  margin: EdgeInsets.only(
                      left: context.x < 768 ? 0 : 20,
                      top: context.x < 768 ? 20 : 0),
                  alignment: Alignment.topCenter,
                  decoration: BoxDecoration(
                    color: ColorHelper.lightBackground3,
                    borderRadius: BorderRadius.circular(16),
                  ),
                  child: Column(
                    children: [
                      Container(
                        padding: const EdgeInsets.all(16),
                        height: 190.dp,
                        decoration: BoxDecoration(
                          color: Colors.white,
                          borderRadius: BorderRadius.circular(16),
                          border: Border.all(
                              color: ColorHelper.flightDividerColor,
                              width: 0.5),
                        ),
                        child: Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            Row(
                              mainAxisAlignment:
                                  MainAxisAlignment.spaceBetween,
                              children: [
                                SvgPicture.asset(
                                    'assets/dashboard/saving.svg'),
                                Obx(() => Container(
                                  padding: const EdgeInsets.symmetric(
                                      horizontal: 12, vertical: 4),
                                  // width: 69.dp,
                                  height: 28.dp,
                                  decoration: BoxDecoration(
                                    borderRadius: BorderRadius.circular(16),
                                    border: Border.all(
                                        color: ColorHelper.flightDividerColor, width: 0.5),
                                  ),
                                  child: DropdownButtonHideUnderline(
                                    child: DropdownButton<String>(
                                      value: controller.savingFilterType.value,
                                      icon: Padding(
                                        padding: const EdgeInsets.only(left: 8),
                                        child: SvgPicture.asset('assets/dashboard/dropdown.svg'),
                                      ),
                                      style: const TextStyle(
                                        fontSize: 12,
                                        fontWeight: FontWeight.w400,
                                        color: ColorHelper.textDark,
                                      ),
                                      onChanged: (String? newValue) {
                                        if (newValue != null) {
                                          if(controller.savingFilterType.value!=newValue){
                                            controller.getBookingStats(newValue, 'savings');
                                          }
                                          controller.savingFilterType.value = newValue;
                                        }
                                      },
                                      items: [
                                        DropdownMenuItem(
                                          value: 'daily',
                                          child: Text('Daily',style: TextStyle(
                                                                    fontSize: 12.dp,
                                                                    fontWeight: FontWeight.w400,
                                                                    color: ColorHelper.textDark,
                                                                  ),),
                                        ),
                                        DropdownMenuItem(
                                          value: 'weekly',
                                          child: Text('Weekly',style: TextStyle(
                                                                    fontSize: 12.dp,
                                                                    fontWeight: FontWeight.w400,
                                                                    color: ColorHelper.textDark,
                                                                  ),),
                                        ),
                                        DropdownMenuItem(
                                          value: 'monthly',
                                          child: Text('Monthly',style: TextStyle(
                                                                    fontSize: 12.dp,
                                                                    fontWeight: FontWeight.w400,
                                                                    color: ColorHelper.textDark,
                                                                  ),),
                                        ),
                                        DropdownMenuItem(
                                          value: 'yearly',
                                          child: Text('Lifetime',style: TextStyle(
                                                                    fontSize: 12.dp,
                                                                    fontWeight: FontWeight.w400,
                                                                    color: ColorHelper.textDark,
                                                                  ),),
                                        ),
                                      ],
                                    ),
                                  ),
                                ))
                              ],
                            ),
                            const SizedBox(
                              height: 28,
                            ),
                            Text(
                              'Total Savings',
                              style: TextStyle(
                                fontSize: 16.dp,
                                fontWeight: FontWeight.w400,
                                color: ColorHelper.textLight,
                              ),
                            ),
                            const SizedBox(
                              height: 6,
                            ),
                            Obx(
                               () {
                                return Text(
                                  '\$${(controller.savingStats.value?.totalSavings??0).priceText}',
                                  style: TextStyle(
                                    fontSize: 28.dp,
                                    fontWeight: FontWeight.w700,
                                    color: ColorHelper.textDark,
                                  ),
                                );
                              }
                            ),
                            const SizedBox(
                              height: 12,
                            ),
                            Row(
                              children: [
                                SvgPicture.asset(
                                    'assets/dashboard/upArrow.svg'),
                                const SizedBox(
                                  width: 2,
                                ),
                                Obx(
                                   () {
                                    return Text(
                                      '${(controller.savingStats.value?.savingsPercentageChange??0.0).toStringAsFixed(2)}% from last month',
                                      style: TextStyle(
                                        fontSize: 12.dp,
                                        fontWeight: FontWeight.w500,
                                        color: ColorHelper.primaryColor1,
                                      ),
                                    );
                                  }
                                ),
                              ],
                            ),
                          ],
                        ),
                      ),
                      const SizedBox(
                        height:11,
                      ),
                      Padding(
                        padding: const EdgeInsets.symmetric(horizontal: 14),
                        child: InkWell(
                          onTap: () => goto(Routes.TOP_FLIGHTS),
                          child: Row(
                            children: [
                              const Text(
                                'Explore More Discounted Flights',
                                style: TextStyle(
                                  fontSize: 12,
                                  fontWeight: FontWeight.w500,
                                  color: ColorHelper.primaryColor1,
                                ),
                              ),
                              const SizedBox(
                                width: 4,
                              ),
                              SvgPicture.asset(
                                'assets/dashboard/rightArrow.svg',
                                color: ColorHelper.primaryColor1,
                              ),
                            ],
                          ),
                        ),
                      ),
                    ],
                  ),
                ),
              ),
              ResponsiveGridCol(
                lg: context.x < 1250 ? 6 : 3,
                md: 6,
                child: Container(
                  width: 353.dp,
                  height: 230.dp,
                  margin: EdgeInsets.only(
                      left: context.x<1250? 0:context.x < 768 ? 0 : 20,
                      top: context.x < 1250 ? 20 : 0),
                  alignment: Alignment.topCenter,
                  decoration: BoxDecoration(
                    color: ColorHelper.lightBackground3,
                    borderRadius: BorderRadius.circular(16),
                  ),
                  child: Column(
                    children: [
                      Expanded(
                        child: Container(
                          padding: const EdgeInsets.fromLTRB(16, 16, 16, 10),
                          width: context.x,
                          decoration: BoxDecoration(
                            color: Colors.white,
                            borderRadius: BorderRadius.circular(16),
                            border: Border.all(
                                color: ColorHelper.flightDividerColor,
                                width: 0.5),
                          ),
                          child: Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: [
                              SvgPicture.asset('assets/dashboard/rate_request.svg'),
                              20.SpaceX,
                              Text(
                                'Exclusive PLUS Round-Trip Rate Request',
                                style: TextStyle(
                                  fontSize: 16.dp,
                                  fontWeight: FontWeight.w400,
                                  color: ColorHelper.neutralLightText,
                                ),
                              ),
                              6.SpaceX,
                              Obx(
                                 () {
                                  return Text(
                                    '${controller.authController.userProfileModel.value.data?.user?.rateRequestRemaining ?? 0}/${controller.authController.userProfileModel.value.data?.user?.rateRequestTotal ?? 0}',
                                    style: TextStyle(
                                      fontSize: 28.dp,
                                      fontWeight: FontWeight.w700,
                                      color: ColorHelper.textDark,
                                    ),
                                  );
                                }
                              ),
                            ],
                          ),
                        ),
                      ),
                      Padding(
                        padding: const EdgeInsets.symmetric(
                            horizontal: 14, vertical: 9),
                        child: Column(
                          children: [
                            Row(
                              mainAxisAlignment:
                                  MainAxisAlignment.spaceBetween,
                              children: [
                                Text(
                                  'Purchased Requests',
                                  style: TextStyle(
                                    fontSize: 12.dp,
                                    fontWeight: FontWeight.w400,
                                    color: ColorHelper.textLight,
                                  ),
                                ),
                                Text(
                                  '0',
                                  style: TextStyle(
                                    fontSize: 12.dp,
                                    fontWeight: FontWeight.w400,
                                    color: ColorHelper.primaryColor1,
                                  ),
                                ),
                              ],
                            ),
                            const SizedBox(
                              height: 6,
                            ),
                            Row(
                              mainAxisAlignment:
                                  MainAxisAlignment.spaceBetween,
                              children: [
                                Text(
                                  'Free Requests Received',
                                  style: TextStyle(
                                    fontSize: 12.dp,
                                    fontWeight: FontWeight.w400,
                                    color: ColorHelper.textLight,
                                  ),
                                ),
                                Obx(
                                  () {
                                    return Text(
                                      (controller.authController.userProfileModel.value.data?.user?.rateRequestTotal ?? 0).toString(),
                                      style: TextStyle(
                                        fontSize: 12.dp,
                                        fontWeight: FontWeight.w400,
                                        color: ColorHelper.primaryColor1,
                                      ),
                                    );
                                  }
                                ),
                              ],
                            ),
                          ],
                        ),
                      ),
                    ],
                  ),
                ),
              ),
              ResponsiveGridCol(
                lg: context.x < 1250 ? 6 : 3,
                md: 6,
                child: Obx(
                  () {
                    final flightSearchCreditAdded = authController.userProfileModel.value.data?.user?.flightSearchCreditAdded ?? 0;
                    final flightSearchCreditAddedPrice = numberFormat.format(flightSearchCreditAdded*0.05);

                    final flightSearchCreditUsed = authController.userProfileModel.value.data?.user?.flightSearchCreditUsed ?? 0;
                    final flightSearchCreditUsedPrice = numberFormat.format(flightSearchCreditUsed*0.05);

                    final availableSearchCredits = flightSearchCreditAdded - flightSearchCreditUsed;
                    final availableSearchCreditPrice = numberFormat.format(availableSearchCredits*0.05);

                    return Container(
                      width: 353.dp,
                      height: 230.dp,
                      margin: EdgeInsets.only(
                          left: context.x < 768 ? 0 : 20,
                          top: context.x < 1250 ? 20 : 0),
                      alignment: Alignment.topCenter,
                      decoration: BoxDecoration(
                        color: ColorHelper.lightBackground3,
                        borderRadius: BorderRadius.circular(16),
                      ),
                      child: Column(
                        children: [
                          Container(
                            padding: const EdgeInsets.all(16),
                            height: 169.dp,
                            width: context.x,
                            decoration: BoxDecoration(
                              color: Colors.white,
                              borderRadius: BorderRadius.circular(16),
                              border: Border.all(
                                  color: ColorHelper.flightDividerColor,
                                  width: 0.5),
                            ),
                            child: Column(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: [
                                InkWell(
                                  onTap: () {
                                    final searchCreditController = Get.put(SearchCreditController());
                                    searchCreditController.buyCreditPopup();
                                  },
                                  child: Row(
                                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                    children: [
                                      Image.asset('assets/search_credit.png',width: 64,height: 17,),
                                      Text(
                                        'Buy Search-Credits',
                                        style: TextStyle(
                                          fontSize: 12.dp,
                                          fontWeight: FontWeight.w400,
                                          color: ColorHelper.primaryColor2,
                                        ),
                                      ),
                                    ],
                                  ),
                                ),
                                const SizedBox(
                                  height: 28,
                                ),
                                Text(
                                  'Search-Credits',
                                  style: TextStyle(
                                    fontSize: 16.dp,
                                    fontWeight: FontWeight.w400,
                                    color: ColorHelper.textLight,
                                  ),
                                ),
                                const SizedBox(
                                  height: 10,
                                ),
                                Row(
                                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                  children: [
                                    Expanded(
                                      child: Column(
                                        crossAxisAlignment: CrossAxisAlignment.start,
                                        children: [
                                          const Text(
                                            'Total Search-Credits',
                                            style: TextStyle(
                                              fontSize: 9,
                                              fontWeight: FontWeight.w400,
                                              color: ColorHelper.textLight,
                                            ),
                                          ),
                                          RichText(
                                            text: TextSpan(
                                              text: 'S',
                                              style: const TextStyle(
                                                fontSize: 14,
                                                fontWeight: FontWeight.w600,
                                                color: ColorHelper.neutralDark,
                                              ),
                                              children: [
                                                const TextSpan(
                                                  text: 'C ',
                                                  style: TextStyle(
                                                    fontSize: 14,
                                                    fontWeight: FontWeight.w600,
                                                    color: ColorHelper.primaryColor2,
                                                  ),
                                                ),
                                                TextSpan(
                                                  text: '$flightSearchCreditAdded ',
                                                  style: const TextStyle(
                                                    fontSize: 14,
                                                    fontWeight: FontWeight.w600,
                                                    color: ColorHelper.neutralDark,
                                                  ),
                                                ),
                                                TextSpan(
                                                  text: '(\$$flightSearchCreditAddedPrice)',
                                                  style: const TextStyle(
                                                    fontSize: 10,
                                                    fontWeight: FontWeight.w600,
                                                    color: ColorHelper.neutralLightText,
                                                  ),
                                                ),
                                              ],
                                            ),
                                          ),
                                        ],
                                      ),
                                    ),
                                    Expanded(
                                      child: Column(
                                        crossAxisAlignment: CrossAxisAlignment.start,
                                        children: [
                                          const Text(
                                            'Available Search-Credits',
                                            style: TextStyle(
                                              fontSize: 9,
                                              fontWeight: FontWeight.w400,
                                              color: ColorHelper.textLight,
                                            ),
                                          ),
                                          RichText(
                                            text: TextSpan(
                                              text: 'S',
                                              style: const TextStyle(
                                                fontSize: 14,
                                                fontWeight: FontWeight.w600,
                                                color: ColorHelper.neutralDark,
                                              ),
                                              children: [
                                                const TextSpan(
                                                  text: 'C ',
                                                  style: TextStyle(
                                                    fontSize: 14,
                                                    fontWeight: FontWeight.w600,
                                                    color: ColorHelper.primaryColor2,
                                                  ),
                                                ),
                                                TextSpan(
                                                  text: '$availableSearchCredits ',
                                                  style: const TextStyle(
                                                    fontSize: 14,
                                                    fontWeight: FontWeight.w600,
                                                    color: ColorHelper.neutralDark,
                                                  ),
                                                ),
                                                TextSpan(
                                                  text: '(\$$availableSearchCreditPrice)',
                                                  style: const TextStyle(
                                                    fontSize: 10,
                                                    fontWeight: FontWeight.w600,
                                                    color: ColorHelper.neutralLightText,
                                                  ),
                                                ),
                                              ],
                                            ),
                                          ),
                                        ],
                                      ),
                                    ),
                                  ],
                                ),
                                const SizedBox(height: 15,),
                                InkWell(
                                  onTap: () {
                                    goto(Routes.TOP_FLIGHTS);
                                  },
                                  child: Row(
                                    children: [
                                      const Text(
                                        'Search Exclusive PLUS Rate Flights',
                                        style: TextStyle(
                                          fontSize: 12,
                                          fontWeight: FontWeight.w500,
                                          color: ColorHelper.primaryColor1,
                                        ),
                                      ),
                                      const SizedBox(
                                        width: 4,
                                      ),
                                      SvgPicture.asset(
                                        'assets/dashboard/rightArrow.svg',
                                        color: ColorHelper.primaryColor1,
                                      ),
                                    ],
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Padding(
                            padding: const EdgeInsets.symmetric(
                                horizontal: 14, vertical: 9),
                            child: Column(
                              children: [
                                Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: [
                                    Text(
                                      'Total Spend',
                                      style: TextStyle(
                                        fontSize: 12.dp,
                                        fontWeight: FontWeight.w400,
                                        color: ColorHelper.textLight,
                                      ),
                                    ),
                                    Text(
                                      'SC $flightSearchCreditUsed (\$$flightSearchCreditUsedPrice)',
                                      style: TextStyle(
                                        fontSize: 12.dp,
                                        fontWeight: FontWeight.w400,
                                        color: ColorHelper.primaryColor1,
                                      ),
                                    ),
                                  ],
                                ),
                                const SizedBox(
                                  height: 6,
                                ),
                                Obx(
                                () => Row(
                                    mainAxisAlignment:
                                        MainAxisAlignment.spaceBetween,
                                    children: [
                                      Text(
                                        'Total \$ Saved',
                                        style: TextStyle(
                                          fontSize: 12.dp,
                                          fontWeight: FontWeight.w400,
                                          color: ColorHelper.textLight,
                                        ),
                                      ),
                                      Text(
                                        '\$${controller.totalSaved.value?.data.price ?? 0}',
                                        style: TextStyle(
                                          fontSize: 12.dp,
                                          fontWeight: FontWeight.w400,
                                          color: ColorHelper.primaryColor1,
                                        ),
                                      ),
                                    ],
                                  ),
                                ),
                              ],
                            ),
                          ),
                        ],
                      ),
                    );
                  }
                ),
              ),
            ],
          ),
          const SizedBox(
            height: 42,
          ),
          //Todo:// Will be implemented later
          // Container(
          //   width: context.x,
          //   height: context.x < 1250 ? null : 524.dp,
          //   decoration: BoxDecoration(
          //       borderRadius: BorderRadius.circular(32),
          //       border: Border.all(
          //           color: ColorHelper.verticalLineColor, width: 0.5)),
          //   child: ResponsiveGridRow(
          //     crossAxisAlignment: CrossAxisAlignment.center,
          //     children: [
          //       ResponsiveGridCol(
          //         lg: context.x < 1250 ? 12 : 6,
          //         child: Padding(
          //           padding: const EdgeInsets.symmetric(
          //               horizontal: 45, vertical: 35),
          //           child: Column(
          //             crossAxisAlignment: CrossAxisAlignment.start,
          //             children: [
          //               const Text(
          //                 'Total Benefits',
          //                 style: TextStyle(
          //                   fontSize: 20,
          //                   fontWeight: FontWeight.w500,
          //                   color: Colors.black,
          //                 ),
          //               ),
          //               Center(
          //                 child: CustomPaint(
          //                   size: const Size(
          //                       400, 400), // Define the canvas size
          //                   painter: BubbleChartPainter(context),
          //                 ),
          //               ),
          //             ],
          //           ),
          //         ),
          //       ),
          //       ResponsiveGridCol(
          //         lg: context.x < 1250 ? 12 : 6,
          //         child: Padding(
          //           padding: const EdgeInsets.symmetric(
          //               horizontal: 45, vertical: 35),
          //           child: Column(
          //             children: [
          //               Row(
          //                 children: [
          //                   Container(
          //                     width: 16,
          //                     height: 16,
          //                     decoration: BoxDecoration(
          //                       color: const Color(0xffBCF4F5),
          //                       borderRadius: BorderRadius.circular(4),
          //                     ),
          //                   ),
          //                   const SizedBox(
          //                     width: 7,
          //                   ),
          //                   Flexible(
          //                     child: Text(
          //                       'Total Saved',
          //                       style: TextStyle(
          //                         fontSize: 14.dp,
          //                         fontWeight: FontWeight.w400,
          //                         color: ColorHelper.textLight,
          //                       ),
          //                     ),
          //                   ),
          //                 ],
          //               ),
          //               const SizedBox(
          //                 height: 25,
          //               ),
          //               Row(
          //                 children: [
          //                   Container(
          //                     width: 16,
          //                     height: 16,
          //                     decoration: BoxDecoration(
          //                       color: const Color(0xffFFDBB5),
          //                       borderRadius: BorderRadius.circular(4),
          //                     ),
          //                   ),
          //                   const SizedBox(
          //                     width: 7,
          //                   ),
          //                   Flexible(
          //                     child: Text(
          //                       'Total Neo Miles received',
          //                       style: TextStyle(
          //                         fontSize: 14.dp,
          //                         fontWeight: FontWeight.w400,
          //                         color: ColorHelper.textLight,
          //                       ),
          //                     ),
          //                   ),
          //                 ],
          //               ),
          //               const SizedBox(
          //                 height: 25,
          //               ),
          //               Row(
          //                 children: [
          //                   Container(
          //                     width: 16,
          //                     height: 16,
          //                     decoration: BoxDecoration(
          //                       color: const Color(0xffE5E2FD),
          //                       borderRadius: BorderRadius.circular(4),
          //                     ),
          //                   ),
          //                   const SizedBox(
          //                     width: 7,
          //                   ),
          //                   Flexible(
          //                     child: Text(
          //                       'Total NEO Miles Redeemed',
          //                       style: TextStyle(
          //                         fontSize: 14.dp,
          //                         fontWeight: FontWeight.w400,
          //                         color: ColorHelper.textLight,
          //                       ),
          //                     ),
          //                   ),
          //                 ],
          //               ),
          //               const SizedBox(
          //                 height: 25,
          //               ),
          //               Row(
          //                 children: [
          //                   Container(
          //                     width: 16,
          //                     height: 16,
          //                     decoration: BoxDecoration(
          //                       color: const Color(0xffD2E2F6),
          //                       borderRadius: BorderRadius.circular(4),
          //                     ),
          //                   ),
          //                   const SizedBox(
          //                     width: 7,
          //                   ),
          //                   Flexible(
          //                     child: Text(
          //                       'Total Shared Benefits',
          //                       style: TextStyle(
          //                         fontSize: 14.dp,
          //                         fontWeight: FontWeight.w400,
          //                         color: ColorHelper.textLight,
          //                       ),
          //                     ),
          //                   ),
          //                 ],
          //               ),
          //               const SizedBox(
          //                 height: 25,
          //               ),
          //               Row(
          //                 children: [
          //                   Container(
          //                     width: 16,
          //                     height: 16,
          //                     decoration: BoxDecoration(
          //                       color: const Color(0xffF4CBC6),
          //                       borderRadius: BorderRadius.circular(4),
          //                     ),
          //                   ),
          //                   const SizedBox(
          //                     width: 7,
          //                   ),
          //                   Flexible(
          //                     child: Text(
          //                       'Total Neo Miles received through Invitations',
          //                       style: TextStyle(
          //                         fontSize: 14.dp,
          //                         fontWeight: FontWeight.w400,
          //                         color: ColorHelper.textLight,
          //                       ),
          //                     ),
          //                   ),
          //                 ],
          //               ),
          //               const SizedBox(
          //                 height: 25,
          //               ),
          //               Row(
          //                 children: [
          //                   Container(
          //                     width: 16,
          //                     height: 16,
          //                     decoration: BoxDecoration(
          //                       color: const Color(0xffDCB6D5),
          //                       borderRadius: BorderRadius.circular(4),
          //                     ),
          //                   ),
          //                   const SizedBox(
          //                     width: 7,
          //                   ),
          //                   Flexible(
          //                     child: Text(
          //                       'Total payments in Crypto Currency',
          //                       style: TextStyle(
          //                         fontSize: 14.dp,
          //                         fontWeight: FontWeight.w400,
          //                         color: ColorHelper.textLight,
          //                       ),
          //                     ),
          //                   ),
          //                 ],
          //               ),
          //               const SizedBox(
          //                 height: 25,
          //               ),
          //               Row(
          //                 children: [
          //                   Container(
          //                     width: 16,
          //                     height: 16,
          //                     decoration: BoxDecoration(
          //                       color: const Color(0xffF8FA90),
          //                       borderRadius: BorderRadius.circular(4),
          //                     ),
          //                   ),
          //                   const SizedBox(
          //                     width: 7,
          //                   ),
          //                   Flexible(
          //                     child: Text(
          //                       'Total Neo Miles received through flight, hotel, etc. (Bookings)',
          //                       style: TextStyle(
          //                         fontSize: 14.dp,
          //                         fontWeight: FontWeight.w400,
          //                         color: ColorHelper.textLight,
          //                       ),
          //                     ),
          //                   ),
          //                 ],
          //               ),
          //             ],
          //           ),
          //         ),
          //       ),
          //     ],
          //   ),
          // ),
          // const SizedBox(
          //   height: 43,
          // ),
          Column(children: [
            Text(
              'Upcoming Flights',
              style: TextStyle(
                fontSize: 20.dp,
                fontWeight: FontWeight.w600,
                color: ColorHelper.textDark,
              ),
            ),
            const SizedBox(
              height: 11,
            ),
          ]),

          Obx(() {
            return controller.upcomingFlightsList.isEmpty
                ? _noUpcomingFlights(context)
                : const SizedBox();
          }),
          Obx(() {
            return Column(
              children: controller.upcomingFlightsList.map((flight) {
                    final flightsData = flight.bookingTrips?.firstOrNull;
                    final flights = (flightsData?.flights ?? []);
                    return Container(
                      padding: const EdgeInsets.symmetric(
                          horizontal: 20, vertical: 24),
                      margin: const EdgeInsets.symmetric(vertical: 4),
                      width: context.x,
                      decoration: BoxDecoration(
                          color: ColorHelper.lightBackground3,
                          borderRadius: BorderRadius.circular(16),
                          border:
                              Border.all(color: ColorHelper.bgPurpleTint, width: 0.5)),
                      child: context.x<768?
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          // First Column
                          Row(
                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
                            children: [
                              Text(
                                '${flight.fromAirport?.municipality} - ${flight.toAirport?.municipality}',
                                style: const TextStyle(
                                  fontSize: 18,
                                  fontWeight: FontWeight.w600,
                                  color: ColorHelper.textDark,
                                ),
                              ),
                              const SizedBox(width: 11),
                              Align(
                                alignment: Alignment.centerRight,
                                child: Container(
                                  width: 67.dp,
                                  height: 24.dp,
                                  alignment: Alignment.center,
                                  decoration: BoxDecoration(
                                    borderRadius:
                                        BorderRadius.circular(4),
                                    border: Border.all(
                                      color: ColorHelper
                                          .verticalLineColor,
                                      width: 0.5,
                                    ),
                                  ),
                                  child: Text(
                                   FlightSearchUtils.mapTripType(flight.tripType ?? '').text.capitalize ?? '',
                                    style: TextStyle(
                                      fontSize: 12.dp,
                                      fontWeight: FontWeight.w400,
                                      color:
                                          ColorHelper.primaryColor1,
                                    ),
                                  ),
                                ),
                              ),
                            ],
                          ),
                          const SizedBox(height: 11),
                          context.x<490?
                          Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: [
                              Text(
                                'Booking ID - ${flight.id ?? 'N/A'}',
                                style: const TextStyle(
                                  fontSize: 12,
                                  fontWeight: FontWeight.w400,
                                  color: ColorHelper.neutralLightText,
                                ),
                              ),
                              const SizedBox(height: 11),
                              Text(
                                'Date of departure ${formatDepartureDate(flight.departureDate)}',
                                style: const TextStyle(
                                  fontSize: 12,
                                  fontWeight: FontWeight.w400,
                                  color: ColorHelper.neutralLightText,
                                ),
                              ),
                            ],
                          )
                          :Row(
                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
                            children: [
                              Text(
                                'Booking ID - ${flight.id ?? 'N/A'}',
                                style: const TextStyle(
                                  fontSize: 12,
                                  fontWeight: FontWeight.w400,
                                  color: ColorHelper.neutralLightText,
                                ),
                              ),
                              const SizedBox(width: 11),
                              Text(
                                'Date of departure ${formatDepartureDate(flight.departureDate)}',
                                style: const TextStyle(
                                  fontSize: 12,
                                  fontWeight: FontWeight.w400,
                                  color: ColorHelper.neutralLightText,
                                ),
                              ),
                            ],
                          ),
                          const SizedBox(height:11),
                          // Second Column
                          Row(
                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
                            children: [
                              Column(
                                crossAxisAlignment:
                                    CrossAxisAlignment.start,
                                children: [
                                  const Text(
                                    'Model',
                                    style: TextStyle(
                                      fontSize: 12,
                                      fontWeight: FontWeight.w400,
                                      color: ColorHelper.textLight,
                                    ),
                                  ),
                                  const SizedBox(height: 8),
                                  Text(
                                    flights.firstOrNull?.aircraftName?.split('/').firstOrNull ?? '',
                                    style: const TextStyle(
                                      fontSize: 12,
                                      fontWeight: FontWeight.w400,
                                      color: ColorHelper.textDarkMed,
                                    ),
                                  ),
                                ],
                              ),
                              Column(
                                crossAxisAlignment:
                                    CrossAxisAlignment.start,
                                children: [
                                  const Text(
                                    'Flight Code',
                                    style: TextStyle(
                                      fontSize: 12,
                                      fontWeight: FontWeight.w400,
                                      color: ColorHelper.textLight,
                                    ),
                                  ),
                                  const SizedBox(height: 8),
                                  Text(
                                    flights.firstOrNull?.flightCode ?? '',
                                    style: const TextStyle(
                                      fontSize: 12,
                                      fontWeight: FontWeight.w400,
                                      color: ColorHelper.textDarkMed,
                                    ),
                                  ),
                                ],
                              ),
                              Row(
                                mainAxisSize: MainAxisSize.min,
                                children: flights
                                        .map(
                                          (f) => Padding(
                                            padding: EdgeInsets.only(
                                                right: 8.dp),
                                            child:
                                                FlightUtils.imageHandler(
                                              f.airlineLogoURL ?? '',
                                              f.airlineName ?? '',
                                              25,
                                              !(flight.isDiscountedFlight ?? true),
                                              f.airlineCode ?? '',
                                            ),
                                          ),
                                        )
                                        .toList()
                              ),
                            ],
                          ),
                          const SizedBox(height:11),
                          // Third Column
                          InkWell(
                            onTap: controller.launchEmail,
                            child: Container(
                              width: 103.dp,
                              height: 32.dp,
                              alignment: Alignment.center,
                              decoration: BoxDecoration(
                                color: Colors.white,
                                borderRadius:
                                    BorderRadius.circular(4),
                              ),
                              child: Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.center,
                                children: [
                                  SvgPicture.asset(
                                    'assets/dashboard/contact.svg',
                                    color: ColorHelper.primaryColor1,
                                  ),
                                  const SizedBox(width: 5),
                                  const Flexible(
                                    child: Text(
                                      'Contact Us',
                                      textAlign: TextAlign.center,
                                      style: TextStyle(
                                        fontWeight: FontWeight.w400,
                                        color:
                                            ColorHelper.primaryColor1,
                                      ),
                                    ),
                                  ),
                                ],
                              ),
                            ),
                          ),
                        ],
                      ):
                       Row(
                        crossAxisAlignment: CrossAxisAlignment.center,
                        children: [
                          // First Column
                          Expanded(
                            flex: 5,
                            child: Column(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: [
                                Row(
                                  children: [
                                    Expanded(
                                      child: Text(
                                        '${flight.fromAirport?.municipality} - ${flight.toAirport?.municipality}',
                                        style: const TextStyle(
                                          fontSize: 20,
                                          fontWeight: FontWeight.w600,
                                          color: ColorHelper.textDark,
                                        ),
                                      ),
                                    ),
                                    Expanded(
                                      child: Align(
                                        alignment: Alignment.centerLeft,
                                        child: Container(
                                          width: 67.dp,
                                          height: 24.dp,
                                          alignment: Alignment.center,
                                          decoration: BoxDecoration(
                                            borderRadius:
                                                BorderRadius.circular(4),
                                            border: Border.all(
                                              color: ColorHelper
                                                  .verticalLineColor,
                                              width: 0.5,
                                            ),
                                          ),
                                          child: Text(
                                           FlightSearchUtils.mapTripType(flight.tripType ?? '').text.capitalize ?? '',
                                            style: TextStyle(
                                              fontSize: 12.dp,
                                              fontWeight: FontWeight.w400,
                                              color:
                                                  ColorHelper.primaryColor1,
                                            ),
                                          ),
                                        ),
                                      ),
                                    ),
                                  ],
                                ),
                                const SizedBox(height: 8),
                                Row(
                                  children: [
                                    Expanded(
                                      child: Text(
                                        'Booking ID - ${flight.id ?? 'N/A'}',
                                        style: const TextStyle(
                                          overflow: TextOverflow.ellipsis,
                                          fontSize: 14,
                                          fontWeight: FontWeight.w400,
                                          color: ColorHelper.neutralLightText,
                                        ),
                                      ),
                                    ),
                                    Expanded(
                                      child: Text(
                                        'Date of departure ${formatDepartureDate(flight.departureDate)}',
                                        style: const TextStyle( overflow: TextOverflow.ellipsis,
                                          fontSize: 14,
                                          fontWeight: FontWeight.w400,
                                          color: ColorHelper.neutralLightText,
                                        ),
                                      ),
                                    ),
                                  ],
                                ),
                              ],
                            ),
                          ),

                          // Second Column
                          Expanded(
                            flex: 4,
                            child: Padding(
                              padding: EdgeInsets.only(
                                  top: context.x < 768 ? 15 : 0),
                              child: Wrap(
                                crossAxisAlignment: WrapCrossAlignment.center,
                                runSpacing: 10,
                                alignment: context.x < 768
                                    ? WrapAlignment.spaceBetween
                                    : WrapAlignment.spaceEvenly,
                                children: [
                                  Column(
                                    crossAxisAlignment:
                                        CrossAxisAlignment.start,
                                    children: [
                                      Text(
                                        'Model',
                                        style: TextStyle(
                                          fontSize: 12.dp,
                                          fontWeight: FontWeight.w400,
                                          color: ColorHelper.textLight,
                                        ),
                                      ),
                                      const SizedBox(height: 8),
                                      Text(
                                        flights.firstOrNull?.aircraftName?.split('/').firstOrNull ?? '',
                                        style: TextStyle(
                                          fontSize: 12.dp,
                                          fontWeight: FontWeight.w400,
                                          color: ColorHelper.textDarkMed,
                                        ),
                                      ),
                                    ],
                                  ),
                                  Column(
                                    crossAxisAlignment:
                                        CrossAxisAlignment.start,
                                    children: [
                                      Text(
                                        'Flight Code',
                                        style: TextStyle(
                                          fontSize: 12.dp,
                                          fontWeight: FontWeight.w400,
                                          color: ColorHelper.textLight,
                                        ),
                                      ),
                                      const SizedBox(height: 8),
                                      Text(
                                        flights.firstOrNull?.flightCode ?? '',
                                        style: TextStyle(
                                          fontSize: 12.dp,
                                          fontWeight: FontWeight.w400,
                                          color: ColorHelper.textDarkMed,
                                        ),
                                      ),
                                    ],
                                  ),
                                  Row(
                                    mainAxisSize: MainAxisSize.min,
                                    children: flights
                                            .map(
                                              (f) => Padding(
                                                padding: EdgeInsets.only(
                                                    right: 8.dp),
                                                child:
                                                    FlightUtils.imageHandler(
                                                  f.airlineLogoURL ?? '',
                                                  f.airlineName ?? '',
                                                  25,
                                                  !(flight.isDiscountedFlight ?? true),
                                                  f.airlineCode ?? '',
                                                ),
                                              ),
                                            )
                                            .toList()
                                  ),
                                ],
                              ),
                            ),
                          ),

                          // Third Column
                          Expanded(
                            flex: 1,
                            child: Center(
                              child: Padding(
                                padding: EdgeInsets.only(
                                    top: context.x < 768 ? 15 : 0),
                                child: InkWell(
                                  onTap: controller.launchEmail,
                                  child: Container(
                                    width: 103.dp,
                                    height: 32.dp,
                                    alignment: Alignment.center,
                                    decoration: BoxDecoration(
                                      color: Colors.white,
                                      borderRadius:
                                          BorderRadius.circular(4),
                                    ),
                                    child: Row(
                                      mainAxisAlignment:
                                          MainAxisAlignment.center,
                                      children: [
                                        SvgPicture.asset(
                                          'assets/dashboard/contact.svg',
                                          color: ColorHelper.primaryColor1,
                                        ),
                                        const SizedBox(width: 5),
                                        const Flexible(
                                          child: Text(
                                            'Contact Us',
                                            textAlign: TextAlign.center,
                                            style: TextStyle(
                                              fontWeight: FontWeight.w400,
                                              color:
                                                  ColorHelper.primaryColor1,
                                            ),
                                          ),
                                        ),
                                      ],
                                    ),
                                  ),
                                ),
                              ),
                            ),
                          ),
                        ],
                      ),
                    );
                  }).toList()

            );
          }),
          const SizedBox(
            height: 64,
          ),
        ],
      ),
    ),
  );
}