isImage method

bool isImage(
  1. String url
)

Implementation

bool isImage(String url) {
  switch (url.split(".").last.toLowerCase()) {
    case "jpg":
    case "png":
    case "jpeg":
      return true;
    default:
      return false;
  }
}