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

Libraries

dio_image_provider