auto_resize_image 1.0.3 copy "auto_resize_image: ^1.0.3" to clipboard
auto_resize_image: ^1.0.3 copied to clipboard

Automatically adjust the image cache size based on the size of the widget.

AutoResizeImage #

pub package

Language: English| 中文简体

Automatically adjust the image cache size based on the size of the widget.

Features #

Supports various types of ImageProviders including NetworkImage, AssetImage, FileImage, etc.

Supports CachedNetworkImageProvider

debugInvertOversizedImages = false debugInvertOversizedImages = true
Screenshot_20240227-183452.jpg Screenshot_20240228-095622.jpg

Usage #

pub package

auto_resize_image:1.0.0
SizedBox(
  width: 200,
  height: 200,
  child: LayoutBuilder(
    builder: (BuildContext context, BoxConstraints constraints) {
      return Image(
        fit: BoxFit.cover,
        image: AutoResizeImage(
          imageProvider: CachedNetworkImageProvider(url),
          width: constraints.maxWidth,
          height: constraints.maxHeight,
        ),
      );
    },
  ),
),

Additional information #

The green box represents the size of the widget, while the red box represents the size of the image cache.

ResizeMode Illustration Clarity/Memory Usage Oversized
contain Low No
balance 20240227_165706.jpg Medium No
cover 20240227_165733.jpg High Yes
7
likes
150
points
42
downloads

Publisher

unverified uploader

Weekly Downloads

Automatically adjust the image cache size based on the size of the widget.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on auto_resize_image