tapFile method

  1. @override
void tapFile(
  1. NsgFilePickerObject? fileObject
)
override

Функция вызывается при тапе на иконке картинки в тексте. Должно вызывыать открытие окна просмотра или обработки файла/излображения

Implementation

@override
void tapFile(NsgFilePickerObject? fileObject) {
  if (fileObject == null) return;
  var curIndex = 0;
  for (var e in files) {
    if (e.id == fileObject.id) {
      break;
    }
    curIndex++;
  }
  if (curIndex >= files.length) {
    curIndex = 0;
  }

  Get.dialog(
    NsgPopUp(
      onCancel: () {
        Get.back();
      },
      onConfirm: () {
        Get.back();
      },
      margin: const EdgeInsets.all(15),
      title: tran.view_files,
      width: Get.width,
      height: Get.height,
      getContent: () => [NsgGallery(imagesList: files, currentPage: curIndex)],
    ),
    barrierDismissible: true,
  );
}