Search packages, repositories and app categories

Package detailsv1.5.0

cached_memory_image

A Flutter library to show images from the Base64, Uint8List and keep them in the cache directory.

AndroidiOSmacOSWindowsLinux
30-day downloads
5.3K
Likes
50
Pub points
140

Install package

flutter pub add cached_memory_image

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

CachedMemoryImage is a Flutter package designed to efficiently display images from Base64 strings or Uint8List data while caching them locally. It ensures fast image loading by storing decoded images in the device's cache directory, reducing redundant processing and network requests. Ideal for apps that handle dynamic or frequently accessed images, it supports multiple platforms including Android, iOS, macOS, Windows, and Linux. The library simplifies image management with minimal setup and integrates seamlessly into existing Flutter projects.

Use cases

  • Displaying base64-encoded images
  • Caching image data locally
  • Loading images from Uint8List
  • Reducing repeated image decoding
  • Offline image access
  • Improving app performance

Key features

  • Supports Base64 and Uint8List inputs
  • Local caching in device cache directory
  • Cross-platform compatibility
  • Automatic image reuse from cache
  • Minimal configuration required
  • Efficient memory usage

Suitable for

  • Apps with dynamic image content
  • Offline-first applications
  • High-frequency image rendering
  • Media-heavy UIs
  • Developers seeking simple image caching
  • Projects requiring lightweight image handling

Considerations

  • Cache size not configurable
  • No built-in image compression
  • Relies on system cache directory
  • Limited control over cache eviction policy
  • Not optimized for large image datasets
  • Requires manual cache clearing if needed

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

cached_memory_image

pub package

A Flutter library to show images from the Base64, Uint8List and keep them in the cache directory.

Features

Check file is exists
final cachedImageManager = CachedImageBase64Manager.instance();

await cachedImageManager?.isExists('app://image/1');
await cachedImageManager?.removeFile('app://image/1');
Cached Image from Base64
  • Widget
CachedMemoryImage(
  uniqueKey: 'app://image/1',
  base64: 'iVBORw0KGgoAAAANSUhEUgAAAk0AAAFwCAYAAACl9k...',
),
  • Image Provider
CachedMemoryImageProvider(
  'app://image/6',
  base64: 'iVBORw0KGgoAAAANSUhEUgAAAk0AAAFwCAYAAACl9k...',
)
Cached Image from Uint8List
  • Widget
CachedMemoryImage(
  uniqueKey: 'app://image/1',
  bytes: Uint8List.fromList([1,2,3,4,5]),
)
  • Image Provider
CachedMemoryImageProvider(
  'app://image/5',
  bytes: Uint8List.fromList([1,2,3,4,5]),
)

Getting started

It is really easy to use! You should ensure that you add the cached_memory_image as a dependency in your flutter project.

cached_memory_image: ^1.5.0

Usage

  • Cached image from Base64 and Display
Padding(
  padding: const EdgeInsets.all(8.0),
  child: CachedMemoryImage(
    uniqueKey: 'app://image/1',
    base64: 'iVBORw0KGgoAAAANSUhEUgAAAk0AAAFwCAYAAACl9k...',
  ),
)
  • Cached image from Uint8List and Display
Padding(
  padding: const EdgeInsets.all(8.0),
  child: CachedMemoryImage(
    uniqueKey: 'app://image/1',
    bytes: Uint8List.fromList([1,2,3,4,5]),
  ),
)

How it works

The cached memory images stores and retrieves files using the flutter_cache_manager.

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package