getProvider method

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

Returns NetworkImage if URI starts with http otherwise uses IO to create File.

Implementation

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