dio_image_provider 0.0.2 copy "dio_image_provider: ^0.0.2" to clipboard
dio_image_provider: ^0.0.2 copied to clipboard

An image provider which makes use of package:dio to instead of dart:io

DIO image provider #

pub package likes popularity pub points

This is an alternative to Image.network() which makes use of the dio package.

Motivation #

By re-using dio as network client for images over the network, you can easily re-use existing authentication code. This also makes it easier to do performance monitoring when used with Sentry, Datadog or similar.

Usage #

Image(
  image: DioImage(Uri.parse('https://http.cat/200')),
)

Optionally, you can supply your own Dio client.

// Either by setting it globally
DioImage.defaultDio = Dio();

// or by supplying it via constructor
Image(
  image: DioImage(
    Uri.parse('https://http.cat/200'),
    dio: Dio(),
  ),
)

If you use http instead of dio, try http_image_provider

📣 About the author #

  • Twitter Follow
  • GitHub followers
8
likes
150
points
140
downloads

Publisher

verified publisheruekoetter.dev

Weekly Downloads

An image provider which makes use of package:dio to instead of dart:io

Repository (GitHub)
View/report issues

Topics

#cupertino-http #cronet-http #image-provider

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

dio, flutter

More

Packages that depend on dio_image_provider