isImageFile static method

bool isImageFile(
  1. String filePath
)

Check if file is image

filePath - The file path Returns true if file is image

Implementation

static bool isImageFile(String filePath) {
  const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg', 'ico'];
  return hasValidExtension(filePath, imageExtensions);
}