showQnAViewDialog function

void showQnAViewDialog(
  1. BuildContext context,
  2. EnxController obj
)

Implementation

void showQnAViewDialog(BuildContext context, EnxController obj) {
  print("++++++${obj.data.length}");
  int safeAreaHeight = (Get.window.viewPadding.bottom.toInt() == 0)
      ? 20
      : Get.window.viewPadding.bottom.toInt();
  double appBarHeight = 0.0;

  showGeneralDialog(
    context: context,
    barrierColor: Colors.white, // Background color
    barrierDismissible: false,
    pageBuilder: (context, __, ___) {
      return Center(
        child: Material(
          type: MaterialType.transparency,
          // Make the dialog background transparent
          child: SizedBox(
              width: MediaQuery.of(context).size.width -
                  MediaQuery.of(context).padding.left +
                  MediaQuery.of(context).padding.right,
              height: Platform.isIOS
                  ? MediaQuery.of(context).size.height - safeAreaHeight
                  : Get.height -
                  appBarHeight -
                  Get.window.viewPadding.top / 2.5 -
                  Get.window.viewPadding.bottom,
              child: Material(
                type: MaterialType.transparency,
                child: Padding(
                  padding: const EdgeInsets.only(
                      left: 8.0, right: 8.0, top: 16.0, bottom: 8.0),
                  child:Column(
                    children: [
                    TabBar(
                    controller: obj.tabController,
                    tabs: [
                      Tab(text: 'OPEN'),
                      Tab(text: 'ANSWER'),
                      Tab(text: 'DISMISSED'),
                    ],
                  ),

                    Expanded(
                        child: TabBarView(
                          controller: obj.tabController,
                          children: [
                            _buildQuestionsList(),
                            _buildQuestionsList(),
                            _buildQuestionsList(),
                          ],
                        ),
                      ),
                      _buildQuestionInput(obj),
                    ],
                  ),
                ),
              )),
        ),
      );
    },
  );


}