customHeader method

Widget customHeader(
  1. SubscriptionsController controller
)

Implementation

Widget customHeader(SubscriptionsController controller) {
  return Padding(
    padding: EdgeInsets.symmetric(vertical: 12.dp),
    child: Row(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        // Menu icon for smaller screens
        Get.width < 960
            ? Builder(
              builder: (context) {
                return IconButton(
                    icon: const Icon(Icons.menu),
                    onPressed: () {
                      Scaffold.of(context).openDrawer();
                    },
                  );
              }
            )
            : Container(),
        12.dp.SpaceY,
        Expanded(
          child: Padding(
            padding: const EdgeInsets.symmetric(horizontal: 32.0, vertical: 8.0),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                const Text(
                  'Subscribed Users',
                  style: TextStyle(
                    fontSize: 20,
                    fontWeight: FontWeight.w600,
                    color: Colors.black,
                  ),
                ),
                10.SpaceX,
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Expanded(
                      child: ResponsiveTabBar(
                          isFullIndicationWidth: true,
                          tabTitles: controller.pageTitle,
                          onSelected: (value) async {
                            controller.selectedTab.value = value;
                            final index = controller.selectedTab.value;
                            if (index == 2) {
                              final bookings =
                                  Get.put(SubscriberBookingHistoryController());
                              await bookings.getBookingHistory();
                              await bookings.getBookingStats();
                            }
                          },
                          selectedTab: controller.selectedTab,
                          titleStyle:  TextStyle(
                              fontSize: 20.dp,
                              fontWeight: FontWeight.w600,
                              color: ColorHelper.primaryBlue,
                            ),
                            inActiveStyle: TextStyle(
                              fontSize: 20.dp,
                              fontWeight: FontWeight.w400,
                              color: ColorHelper.neutralLightText,
                            ),
                            rightSpacing: 32.dp,
                          ),
                    ),
                    if (Get.width > 1000) activeButtonWidget()
                  ],
                ),
              ],
            ),
          ),
        ),
      ],
    ),
  );
}