pageContent method

Widget pageContent()

Implementation

Widget pageContent() {
  return LayoutBuilder(builder: (context, _) {
    final isPhone = Get.width <= 960;
    return Padding(
      padding: EdgeInsets.symmetric(
          horizontal: isPhone ? 20.dp : 32.dp, vertical: 22.dp),
      child: Obx(
        () => Column(
          mainAxisAlignment: MainAxisAlignment.start,
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [

            if (Get.width < 960) ...[
              const Text(
                "View and manage all incoming booking requests, including passenger details, travel dates, and destinations. Approve, reject, or modify requests efficiently with search and filter options. \n Dashboard updates every 60 seconds",
                style: TextStyle(
                  fontSize: 14,
                  fontWeight: FontWeight.w400,
                  color: ColorHelper.neutralText02,
                ),
              ),
              16.SpaceX,
            ],
            Row(
              mainAxisAlignment: MainAxisAlignment.start,
              children: [
                Text(
                  'Booking Request Analytics',
                  style: TextStyle(
                    fontSize: 16.dp,
                    fontWeight: FontWeight.w600,
                    color: ColorHelper.neutralMediumText,
                  ),
                ),
              ],
            ),
            12.SpaceX,
            ResponsiveGridRow(
              children: [
                ResponsiveGridCol(
                  lg: 6,
                  md: 6,
                  sm: 12,
                  xs: 12,
                  child: Container(
                    margin: EdgeInsets.only(left: Get.width<768? 0: 13),
                    alignment: Alignment.topCenter,
                    height: 106,
                    decoration: BoxDecoration(
                      color: ColorHelper.lightBg02,
                      borderRadius: BorderRadius.circular(16),
                      border: Border.all(color: ColorHelper.purpleTint,width: 0.5),
                    ),
                    child: Column(
                      children: [
                        Container(
                          height: 72,
                          decoration: const BoxDecoration(
                            color: Colors.white,
                            border: Border.symmetric(horizontal: BorderSide(color: ColorHelper.purpleTint,width: 0.5)),
                            borderRadius: BorderRadius.only(
                              topLeft: Radius.circular(16),
                              topRight: Radius.circular(16),
                            ),
                          ),
                          child: Row(
                            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                            children: [
                              Column(
                                crossAxisAlignment: CrossAxisAlignment.center,
                                mainAxisAlignment: MainAxisAlignment.center,
                                children: [
                                  Text(
                                    (controller.bookingCounts.value?.counts?.oneDay?.paid ?? 0).toString(),
                                    style: const TextStyle(
                                      fontSize: 28,
                                      fontWeight: FontWeight.w700,
                                      color: ColorHelper.neutralDark,
                                    ),
                                  ),
                                  5.SpaceX,
                                  const Text('One Day',
                                    style: TextStyle(
                                      fontSize: 14,
                                      fontWeight: FontWeight.w500,
                                      color: ColorHelper.neutralLightText,
                                    ),
                                  ),
                                ],
                              ),
                              Container(
                                width: 0.5,
                                height: 72,
                                color: ColorHelper.purpleTint,
                              ),
                              Column(
                                crossAxisAlignment: CrossAxisAlignment.center,
                                mainAxisAlignment: MainAxisAlignment.center,
                                children: [
                                  Text(
                                    (controller.bookingCounts.value?.counts?.oneWeek?.paid ?? 0).toString(),
                                    style: const TextStyle(
                                      fontSize: 28,
                                      fontWeight: FontWeight.w700,
                                      color: ColorHelper.neutralDark,
                                    ),
                                  ),
                                  5.SpaceX,
                                  const Text('One Week',
                                    style: TextStyle(
                                      fontSize: 14,
                                      fontWeight: FontWeight.w500,
                                      color: ColorHelper.neutralLightText,
                                    ),
                                  ),
                                ],
                              ),
                              Container(
                                width: 0.5,
                                height: 72,
                                color: ColorHelper.purpleTint,
                              ),


                              Column(
                                crossAxisAlignment: CrossAxisAlignment.center,
                                mainAxisAlignment: MainAxisAlignment.center,
                                children: [
                                  Text(
                                    (controller.bookingCounts.value?.counts?.oneMonth?.paid ?? 0).toString(),
                                    style: const TextStyle(
                                      fontSize: 28,
                                      fontWeight: FontWeight.w700,
                                      color: ColorHelper.neutralDark,
                                    ),
                                  ),
                                  5.SpaceX,
                                  const Text('One Month',
                                    style: TextStyle(
                                      fontSize: 14,
                                      fontWeight: FontWeight.w500,
                                      color: ColorHelper.neutralLightText,
                                    ),
                                  ),
                                ],
                              ),
                            ],
                          ),
                        ),
                        3.SpaceX,
                        const Text(
                          'Paid Open Requests',
                          style: TextStyle(
                            fontSize: 20,
                            fontWeight: FontWeight.w600,
                            color: ColorHelper.primary1,
                          ),
                        ),
                      ],
                    ),
                  ),
                ),
                ResponsiveGridCol(
                  lg: 6,
                  md: 6,
                  sm: 12,
                  xs: 12,
                  child: Container(
                    alignment: Alignment.topCenter,
                    margin: EdgeInsets.only(right: Get.width<768? 0: 13, bottom: Get.width<768? 26:0),
                    height: 106,
                    decoration: BoxDecoration(
                      color: ColorHelper.lightBg02,
                      borderRadius: BorderRadius.circular(16),
                      border: Border.all(color: ColorHelper.purpleTint,width: 0.5),
                    ),
                    child: Column(
                      children: [
                        Container(
                          height: 72,
                          decoration: const BoxDecoration(
                            color: Colors.white,
                            border: Border.symmetric(horizontal: BorderSide(color: ColorHelper.purpleTint,width: 0.5)),
                            borderRadius: BorderRadius.only(
                              topLeft: Radius.circular(16),
                              topRight: Radius.circular(16),
                            ),
                          ),
                          child: Row(
                            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                            children: [
                              Column(
                                crossAxisAlignment: CrossAxisAlignment.center,
                                mainAxisAlignment: MainAxisAlignment.center,
                                children: [
                                  Text(
                                    (controller.bookingCounts.value?.counts?.oneDay?.confirmed ?? 0).toString(),
                                    style: const TextStyle(
                                      fontSize: 28,
                                      fontWeight: FontWeight.w700,
                                      color: ColorHelper.neutralDark,
                                    ),
                                  ),
                                  5.SpaceX,
                                  const Text('One Day',
                                  style: TextStyle(
                                    fontSize: 14,
                                    fontWeight: FontWeight.w500,
                                    color: ColorHelper.neutralLightText,
                                  ),
                                  ),
                                ],
                              ),
                              Container(
                                width: 0.5,
                                height: 72,
                                color: ColorHelper.purpleTint,
                              ),
                              Column(
                                crossAxisAlignment: CrossAxisAlignment.center,
                                mainAxisAlignment: MainAxisAlignment.center,
                                children: [
                                  Text(
                                    (controller.bookingCounts.value?.counts?.oneWeek?.confirmed ?? 0).toString(),
                                    style: const TextStyle(
                                      fontSize: 28,
                                      fontWeight: FontWeight.w700,
                                      color: ColorHelper.neutralDark,
                                    ),
                                  ),
                                  5.SpaceX,
                                  const Text('One Week',
                                  style: TextStyle(
                                    fontSize: 14,
                                    fontWeight: FontWeight.w500,
                                    color: ColorHelper.neutralLightText,
                                  ),
                                  ),
                                ],
                              ),
                              Container(
                                width: 0.5,
                                height: 72,
                                color: ColorHelper.purpleTint,
                              ),

                              Column(
                                crossAxisAlignment: CrossAxisAlignment.center,
                                mainAxisAlignment: MainAxisAlignment.center,
                                children: [
                                  Text(
                                    (controller.bookingCounts.value?.counts?.oneMonth?.confirmed ?? 0).toString(),
                                    style: const TextStyle(
                                      fontSize: 28,
                                      fontWeight: FontWeight.w700,
                                      color: ColorHelper.neutralDark,
                                    ),
                                  ),
                                  5.SpaceX,
                                  const Text('One Month',
                                  style: TextStyle(
                                    fontSize: 14,
                                    fontWeight: FontWeight.w500,
                                    color: ColorHelper.neutralLightText,
                                  ),
                                  ),
                                ],
                              ),
                            ],
                          ),
                        ),
                        3.SpaceX,
                        const Text(
                          'Confirmed',
                          style: TextStyle(
                            fontSize: 20,
                            fontWeight: FontWeight.w600,
                            color: ColorHelper.primary1,
                          ),
                        ),
                      ],
                    ),
                  ),
                ),

              ],
            ),
            12.SpaceX,
            Obx(() {
              if (controller.isLoading.value) {
                return const SizedBox();
              }

              return Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  _requestsTable(),
                  24.SpaceX,
                ],
              );
            }),
          ],
        ),
      ),
    );
  });
}