safe_image 0.1.0 copy "safe_image: ^0.1.0" to clipboard
safe_image: ^0.1.0 copied to clipboard

Safe image loading from URL with native downsampling. Prevents OOM crashes and UI jank with streaming download, disk caching, and concurrency control.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return SafeImageScope(
      config: const SafeImageConfig(targetMaxSide: 2048, quality: 80),
      child: MaterialApp(
        home: Scaffold(
          appBar: AppBar(title: const Text('Safe Image Example')),
          body: Center(
            child: SafeImageWidget(
              url: 'https://picsum.photos/4000/3000',
              width: 300,
              height: 200,
              fit: BoxFit.cover,
              placeholder: (_) => const SizedBox(
                width: 300,
                height: 200,
                child: Center(child: CircularProgressIndicator()),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
0
likes
0
points
8
downloads

Publisher

unverified uploader

Weekly Downloads

Safe image loading from URL with native downsampling. Prevents OOM crashes and UI jank with streaming download, disk caching, and concurrency control.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

crypto, flutter, http, path, path_provider

More

Packages that depend on safe_image

Packages that implement safe_image