flutter_image_cache 1.0.2 copy "flutter_image_cache: ^1.0.2" to clipboard
flutter_image_cache: ^1.0.2 copied to clipboard

A Flutter package for image caching with automatic cache management.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_image_cache/flutter_image_cache.dart';

final CacheManager cacheManager = CacheManager(maxCacheSize: CacheSize(miB: 20));

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text("Demo"),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            CachedImage(
              "https://example.com/image.jpg"
              ,
              cacheManager: cacheManager
            )
          ],
        ),
      ),
    );
  }
}
0
likes
150
points
182
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for image caching with automatic cache management.

Repository (GitHub)
View/report issues

Topics

#cache #image #image-cache #network-image

Documentation

API reference

License

MIT (license)

Dependencies

crypto, dio, flutter, mutex, path, path_provider, sqflite

More

Packages that depend on flutter_image_cache