precached_network_image 1.0.0 copy "precached_network_image: ^1.0.0" to clipboard
precached_network_image: ^1.0.0 copied to clipboard

Flutter library to load and cache network images to disk and support to precache images to memory in advance to avoid the flash screen caused by the delay time.

Precached network image #

pub packageStar on Github

Flutter library to load and cache network images to disk and support to precache images to memory in advance to avoid the flash screen caused by the delay time.

Usage #

The PrecachedNetworkImage can be used directly.

PrecachedNetworkImage(
  url: 'https://picsum.photos/200',
  width: 200, 
  height: 200,
  precache: true, // default is false, true for next time loading from memory in advance.
  placeholder: Image.asset(
    "assets/images/default.png",
    fit: BoxFit.fill,
  ),
),

When you want to precache images to memory to avoid the delay time, you can call PrecachedNetworkImageManager's precacheNetworkImages() which read the disk's files to memory like on the launch widget in advance.

@override
void initState() {
  super.initState();
  PrecachedNetworkImageManager.instance.precacheNetworkImages();
}

Author #

Visit my github: janlionly
Contact with me by email: janlionly@gmail.com

Contribute #

I would love you to contribute to PrecachedNetworkImage

License #

PrecachedNetworkImage is available under the MIT license. See the LICENSE file for more info.

4
likes
0
pub points
73%
popularity

Publisher

unverified uploader

Flutter library to load and cache network images to disk and support to precache images to memory in advance to avoid the flash screen caused by the delay time.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, http, path, path_provider, shared_preferences

More

Packages that depend on precached_network_image