isSupportedFile static method

bool isSupportedFile(
  1. String filename
)

Checks if the given filename corresponds to a supported file type.

Implementation

static bool isSupportedFile(String filename) {
  const supportedExtensions = [
    'jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', // Image files
    'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', // Office files
    'mp4', 'mov', 'avi', 'mkv', 'flv', 'wmv', 'webm', // Video files
    'pdf', // PDF files
    'zip', // Zip files
    'txt' // Text files
  ];
  return _hasExtension(filename, supportedExtensions);
}