isImageUrl function

bool isImageUrl(
  1. dynamic t
)

Implementation

bool isImageUrl(t) {
  if (t == null || t == '') return false;
  if (t.startsWith('http://') || t.startsWith('https://')) {
    if (t.endsWith('.jpg') || t.endsWith('.jpeg') || t.endsWith('.gif') || t.endsWith('.png')) {
      return true;
    }
  }
  return false;
}