Last updated:
0 purchases
http image provider
HTTP image provider #
This is an alternative to Image.network() which makes use of the http package.
Usage #
Image(
image: HttpImageProvider(Uri.parse('https://http.cat/200')),
)
copied to clipboard
Optionally, you can supply your own Client.
// Either by setting it globally
HttpImageProvider.defaultClient = Client();
// or by supplying it via constructor
Image(
image: HttpImageProvider(
Uri.parse('https://http.cat/200'),
client: Client(),
),
)
copied to clipboard
If you use dio instead of http, try dio_image_provider
Why would I want to use this? #
Using the http package allows you to dynamically configure the implementation for how requests are made. In particular, this is useful if you need to use cupertino_http or cronet_http to request images. Another use case is if you need to trace HTTP requests with tools like Sentry.
📣 About the author #
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.