morpheme_cached_network_image 2.0.0 copy "morpheme_cached_network_image: ^2.0.0" to clipboard
morpheme_cached_network_image: ^2.0.0 copied to clipboard

Flutter library to load and cache network images. Can also be used with loading and error widgets.

Morpheme Cached Network Image #

A flutter library to show images from the internet and keep them in the cache directory powered with Objectbox.

How to use #

The MorphemeCachedNetworkImage can be used directly or through the ImageProvider.

Need to MorphemeCachedNetworkImageManager.instance.init in first main.

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await MorphemeCachedNetworkImageManager.instance.init();

  runApp(const MyApp());
}

With a loading:

MorphemeCachedNetworkImage(
  imageUrl: 'https://picsum.photos/id/2/200',
  loadingBuilder: (context) => const CircularProgressIndicator(),
  errorBuilder: (context, error, stackTrace) => const Icon(Icons.error),
);
Image(image: MorphemeCachedNetworkImageProvider(url))

When you want to set as background you can do with container:

Container(
    width: 200,
    height: 200,
    decoration: BoxDecoration(
        image: DecorationImage(
            image: MorphemeCachedNetworkImageProvider(
            'https://picsum.photos/id/2/200',
            ),
        ),
    ),
),
8
likes
150
points
93
downloads

Publisher

verified publishermorpheme.design

Weekly Downloads

Flutter library to load and cache network images. Can also be used with loading and error widgets.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flat_buffers, flutter, http, objectbox, objectbox_flutter_libs, path_provider

More

Packages that depend on morpheme_cached_network_image