NetworkImage class

An ImageProvider that loads an image from an HTTP(S) URL.

Image(image: NetworkImage('https://example.com/photo.png'))
Inheritance

Constructors

NetworkImage(String url, {Map<String, String> headers = const {}, int? maximumBytes, int? decodeFrame, Set<String> allowedContentTypes = const <String>{}, Set<String> blockedContentTypes = const <String>{}})
const

Properties

allowedContentTypes Set<String>
Optional allow-list of MIME types such as image/png or image/*.
final
blockedContentTypes Set<String>
Optional deny-list of MIME types such as image/gif.
final
decodeFrame int?
Optional frame index to decode for animated image formats.
final
hashCode int
The hash code for this object.
no setteroverride
headers Map<String, String>
Optional request headers.
final
maximumBytes int?
Optional maximum response size in bytes.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
url String
The URL to fetch.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve() Future<ImageData>
Resolves and returns the image data.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override