download_network_images_for_offline 0.0.4

Flutter Android iOS

A simple flutter package that saves network images for whenever the user is offline

download_network_images_for_offline #

Build Status

A flutter plugin to use Network Images and store them locally incase the user is offline.

In more detail:

NetworkImageForOffline will check for internet access, when it has internet access it will use the networkImage and download the file if it has not been downloaded yet. If internet access is not available it will use the downloaded file, when that file was not installed yet it will show a loading placeholder.

Arguments:

This package provides the NetworkImageForOffline package, It takes 3 required arguments: file, url, imageBuilder

The file arguments takes a File class, the file defines where it should download the image.

The url argument takes a simple string to where the network image is defined.

The imageBuilder argument takes a function that returns 2 arguments (context, ImageProvider) You can return a widget that requires the imageProvider.

Usage: #

NetworkImageForOffline(
 file: File('$externalStorageDir/offlineImages/$imageName.jpg'),
 url: 'https://i.imgur.com/ViZKPUs.jpeg',
 imageBuilder: (BuildContext context, ImageProvider imageProvider) {
  return ListTile(
   leading: CircleAvatar(
    backgroundImage: imageProvider,
   ),
   title: Text('Hello'),
  );
 },
),
2
likes
90
pub points
36%
popularity

Publisher

martvenck.com

A simple flutter package that saves network images for whenever the user is offline

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD (LICENSE)

Dependencies

connectivity, flutter, http

More

Packages that depend on download_network_images_for_offline