checkIsUnsupportedFile static method

bool checkIsUnsupportedFile(
  1. String fileName,
  2. String action
)

Implementation

static bool checkIsUnsupportedFile(String fileName, String action) {
  bool isUnsupportedFile = false;
  String message = '';
  switch (action) {
    case 'open':
      isUnsupportedFile = isUnsupportedViewFile(fileName);
      if (isUnsupportedFile) message = 'unsupported_file_for_download_view'.tr;
      break;
    case 'print':
      isUnsupportedFile = isUnsupportedPrintFile(fileName);
      if (isUnsupportedFile) message = 'unsupported_file_for_print'.tr;
      break;
  }
  if (message.isNotEmpty) {
    UFUToast.showToast(message);
  }
  return isUnsupportedFile;
}