buildFilesTab method

Widget buildFilesTab(
  1. GenericUploadController controller
)

Implementation

Widget buildFilesTab(GenericUploadController controller) {
  return Column(
    spacing: 10,
    children: [
      if (!controller.isViewScreen.value)
        FilePickerWidget(
          icon: Icons.insert_drive_file_outlined,
          title: 'Click here to pick files',
          onTap: controller.pickFiles,
          appList: controller.files,
          onClearPressed: controller.clearMedia,
          showDeleteIcon: canDeleteAll,
        ),
      Expanded(
        child: Obx(() {
          if (controller.files.isEmpty) {
            return const Center(child: NoDataFound());
          }

          return SingleChildScrollView(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                // Files list
                buildFilesList(controller),
              ],
            ),
          );
        }),
      ),
      Row(
        spacing: 10,
        mainAxisAlignment: MainAxisAlignment.end,
        children: [
          buildSaveAttachmentButton(controller),
          AppButton(
              isCancelButton: true,
              onPressed: () {
                if (!controller.isEditScreen.value) {
                  controller.clearMedia();
                }

                Get.back();
              },
              text: 'Close')
        ],
      ),
    ],
  );
}