getProvider method

  1. @override
ImageProvider<Object> getProvider(
  1. String uri, {
  2. Map<String, String>? headers,
})
override

Returns NetworkImage if URI starts with http otherwise returns transparent image.

Implementation

@override
ImageProvider getProvider(String uri, {Map<String, String>? headers}) {
  if (uri.startsWith('http') || uri.startsWith('blob')) {
    return NetworkImage(uri, headers: headers);
  } else {
    return MemoryImage(kTransparentImage);
  }
}