mainContainer method

Widget mainContainer()

Implementation

Widget mainContainer() {
  return LayoutBuilder(builder: (context, _) {
    final isPhone = Get.width <= 960;
    return Padding(
      padding: EdgeInsets.only(
          left: isPhone ? 20.dp : 32.dp, right: isPhone ? 20.dp : 32.dp),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          if (isPhone) 16.dp.SpaceX,
          // Row(
          //   children: [
          //     Expanded(
          //       flex: 1,
          //       child: searchContainer(),
          //     ),
          //     const Expanded(
          //       flex: 1,
          //       child: SizedBox(),
          //     ),
          //     InkWell(
          //       onTap: controller.openFilter,
          //       child: Container(
          //         width: 32.dp,
          //         height: 32.dp,
          //         alignment: Alignment.center,
          //         decoration: BoxDecoration(
          //           color: ColorHelper.lightBg02,
          //           borderRadius: BorderRadius.circular(4.dp),
          //         ),
          //         child: SvgPicture.asset(
          //           "assets/requests/ic_filter.svg",
          //           width: 24,
          //           height: 24,
          //         ),
          //       ),
          //     ),
          //   ],
          // ),
          // 16.SpaceX,

          ResponsiveGridRow(children: [
            ResponsiveGridCol(
                lg: 12,
                md: 12,
                sm: 12,
                xs: 12,
                child: ResponsiveGridRow(
                  children: [
                    ResponsiveGridCol(
                      child: Column(
                        children: [
                          Obx(() => Visibility(
                                visible: controller
                                    .searchSubscriberValue.value.isNotEmpty,
                                child: Column(
                                  children: [
                                    5.h.SpaceX,
                                    Text(controller
                                        .searchSubscriberValue.value),
                                    5.h.SpaceX,
                                  ],
                                ),
                              )),
                          Obx(() => tb.ResponsiveDataTable<Subscriber>(
                                header: searchContainer(),
                                onFilterClicked: controller.openFilter,
                                onCellClicked: (subscriber) {
                                  openSubscriberInfo(subscriber);
                                },
                                columns: [
                                  tb.DataColumn(
                                    label: 'Full Name',
                                    width: 1,
                                    text: (request) =>
                                        '${request.firstName} ${request.lastName}',
                                  ),
                                  tb.DataColumn(
                                    label: 'Email',
                                    width: Get.width > 1400 ? 2 : 1.6,
                                    text: (request) => request.email,
                                  ),
                                  tb.DataColumn(
                                    label: 'Phone Number',
                                    width: 1.3,
                                    text: (request) => request.phone ?? "",
                                  ),
                                  tb.DataColumn(
                                    label: 'License Type',
                                    width: 0.9,
                                    text: (request) => request.isCorporate
                                        ? 'Corporate'
                                        : 'Individual',
                                  ),
                                  tb.DataColumn(
                                    label: 'Rank MLM',
                                    width: 0.8,
                                    text: (request) =>
                                        request.rank ?? 'Director',
                                  ),
                                  tb.DataColumn(
                                    label: 'Neo Miles',
                                    width: Get.width > 1400 ? 2 : 1.2,
                                    text: (request) =>
                                        request.neoMilesWallet ?? '0',
                                  ),
                                  tb.DataColumn(
                                    label: 'Referred By',
                                    width: 0.7,
                                    text: (request) =>
                                        request.referralCode ?? '0',
                                  ),
                                  tb.DataColumn(
                                    label: 'Status',
                                    width: 0.8,
                                    text: (request) =>
                                        request.lastSubscription?.status ??
                                        '',
                                  ),
                                  tb.DataColumn(
                                    label: '',
                                    width: 0.4,
                                    builder: (request) {
                                      return const Padding(
                                        padding:
                                            EdgeInsets.fromLTRB(0, 24, 8, 14),
                                        child: SizedBox(
                                          height: 16,
                                          child: Icon(
                                            Icons.more_vert,
                                            size: 20,
                                          ),
                                        ),
                                      );
                                    },
                                  ),
                                ],
                                currentPage: controller.currentPage.value,
                                totalPages: controller.totalPages.value,
                                totalRows: controller.totalSubscribers.value,
                                rowsPerPage: controller.rowsPerPage.value,
                                nextPage: controller.nextPage,
                                previousPage: controller.previousPage,
                                pageOpened: controller.goToPage,
                                values: controller.listSubscribers.value,
                                updateRowsPerPage:
                                    controller.updateRowsPerPage,
                              )),
                          20.SpaceX,
                        ],
                      ),
                    )
                  ],
                ))
          ])
        ],
      ),
    );
  });
}