disposable_cached_images 1.2.1 copy "disposable_cached_images: ^1.2.1" to clipboard
disposable_cached_images: ^1.2.1 copied to clipboard

A flutter package for displaying and releasing images from memory.

example/example.md

Open full example in github

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

void main() {
  WidgetsFlutterBinding.ensureInitialized();

  await DisposableImages.init();

  runApp(const DisposableImages(MyApp()));
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: GridView.builder(
          // RepaintBoundaries is enabled by default in DisposableCachedImage widget
          addRepaintBoundaries: false,
          padding: const EdgeInsets.all(20),
          gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
            crossAxisCount: 2,
            mainAxisSpacing: 20,
            crossAxisSpacing: 20,
          ),
          itemCount: images.length,
          itemBuilder: (context, index) => DisposableCachedImage.network(imageUrl: images[index]),
        ),
      ),
    );
  }

  static final images = List.generate(
    500,
    (final i) => 'https://picsum.photos/id/$i/200/300',
  );
}

37
likes
150
points
657
downloads

Publisher

unverified uploader

Weekly Downloads

A flutter package for displaying and releasing images from memory.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_riverpod, isolate_generator_annotation, js, path_provider

More

Packages that depend on disposable_cached_images