pageContent method

Widget pageContent()

Implementation

Widget pageContent() {
  return LayoutBuilder(
    builder: (context, _) {
      final isPhone = Get.width <= 960;
      return Padding(
        padding: EdgeInsets.only(left: isPhone ? 20.dp : 32.dp, right: 8.dp),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            if (isPhone)
              20.dp.SpaceX,
            8.dp.SpaceX,
            ResponsiveGridRow(
              rowSegments: 10,
              children: [
                ResponsiveGridCol(
                  xl: Get.width > 1450 ? 4 : 8,
                  lg: 8,
                  md: 10,
                  sm: 10,
                  xs: 10,
                  child: const FlightRequestsCard(),
                ),
                ResponsiveGridCol(
                  xl: Get.width > 1450 ? 6 : 10,
                  lg: 10,
                  md: 10,
                  sm: 10,
                  xs: 10,
                  child: Obx(
                    () {
                      final analytics = controller.dashboardAnalytics.value.analytics;
                      return ResponsiveGridRow(
                        children: [
                          ResponsiveGridCol(
                            xl: 6,
                            lg: 6,
                            md: 8,
                            sm: 12,
                            xs: 12,
                            child:  SmallChartCard(
                              title: "Total Profit",
                              value: "${analytics?.totalProfitCurrency ?? 'USD'} ${controller.shortTotalProfit(analytics?.totalProfit ?? 0)}",
                              backgroundColor: const Color(0xFFECE2DE),
                              svgPath: "assets/home/ic_profit.svg",
                            ),
                          ),
                          ResponsiveGridCol(
                            xl: 6,
                            lg: 6,
                            md: 8,
                            sm: 12,
                            xs: 12,
                            child: SmallChartCard(
                              title: "Total Tickets Sold ",
                              value: '${analytics?.totalNoOfBookingsSold ?? 0}',
                              backgroundColor: const Color(0xFFCCE8EE),
                              svgPath: "assets/home/ic_tickets.svg",
                            ),
                          ),
                          ResponsiveGridCol(
                            xl: 6,
                            lg: 6,
                            md: 8,
                            sm: 12,
                            xs: 12,
                            child: SmallChartCard(
                              title: "Founders",
                              value: '${analytics?.totalNoOfFounders ?? 0}',
                              backgroundColor: const Color(0xFFC9CDEF),
                              svgPath: "assets/home/ic_founders.svg",
                              widget: Padding(
                                padding: EdgeInsets.only(right: 15.dp),
                                child: Text(
                                  "Total Slots : ${analytics?.totalNoOfFounders ?? 0}",
                                  style: TextStyle(
                                    fontSize: 14.dp,
                                    fontWeight: FontWeight.w400,
                                    color: ColorHelper.neutralText,
                                  ),
                                ),
                              ),
                            ),
                          ),
                          ResponsiveGridCol(
                            xl: 6,
                            lg: 6,
                            md: 8,
                            sm: 12,
                            xs: 12,
                            child: SmallChartCard(
                              title: "Neo Miles Given",
                              value: '${analytics?.totalNEOMilesGiven ?? 0}',
                              backgroundColor: const Color(0xFFB0C7E5),
                              svgPath: "assets/home/ic_neo_miles.svg",
                              widget: Padding(
                                padding: EdgeInsets.only(right: 4.dp),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  crossAxisAlignment: CrossAxisAlignment.center,
                                  children: [
                                    SvgPicture.asset(
                                      "assets/home/ic_profile.svg",
                                      width: 24.dp,
                                      height: 24.dp,
                                    ),
                                    Text(
                                      "Subscribers: ${analytics?.totalNoOfSubscribers ?? 0}",
                                      style: TextStyle(
                                        fontSize: 14.dp,
                                        fontWeight: FontWeight.w400,
                                        color: ColorHelper.neutralText,
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                            ),
                          ),
                        ],
                      );
                    }
                  ),
                ),
              ],
            ),
            ResponsiveGridRow(
              rowSegments: 12,
              children: [
                ResponsiveGridCol(
                  xl: Get.width > 1450 ? 6 : 12,
                  lg: 12,
                  md: 12,
                  sm: 12,
                  xs: 12,
                  child: RecentRequestsCard(),
                ),
                ResponsiveGridCol(
                  xl: Get.width > 1450 ? 3 : 6,
                  lg: 6,
                  md: 8,
                  sm: 12,
                  xs: 12,
                  child: const EarningsCard(),
                ),
                ResponsiveGridCol(
                  xl: Get.width > 1450 ? 3 : 6,
                  lg: 6,
                  md: 8,
                  sm: 12,
                  xs: 12,
                  child: AgentsCard(),
                ),
              ],
            ),
            28.dp.SpaceX,
          ],
        ),
      );
    }
  );
}