isImageFile function

bool isImageFile(
  1. String fileName
)

Checking valid image file

Implementation

bool isImageFile(String fileName) {
  return fileName.endsWith('.png') ||
      fileName.endsWith('.jpg') ||
      fileName.endsWith('.jpeg');
}