flutter_network_image 0.0.6+1 copy "flutter_network_image: ^0.0.6+1" to clipboard
flutter_network_image: ^0.0.6+1 copied to clipboard

flutter package that provides a robust ImageProvider that automatically retries failed network image loads, ensuring smooth image loading on mobile and web platforms.

example/lib/main.dart

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

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

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Flutter Demo'),
        ),
        body: Center(
          child: Image(
            image: NetworkImageProvider(
              'https://example.com/image.png',
              retryWhen: (Attempt attempt) => attempt.counter < 10,
            ),
            loadingBuilder: (context, child, loadingProgress) {
              if (loadingProgress == null) {
                return child;
              }

              return CircularProgressIndicator(
                value: loadingProgress.cumulativeBytesLoaded /
                    (loadingProgress.expectedTotalBytes ?? 1),
              );
            },
            width: 300,
          ),
        ),
      ),
    );
  }
}
9
likes
0
pub points
76%
popularity

Publisher

unverified uploader

flutter package that provides a robust ImageProvider that automatically retries failed network image loads, ensuring smooth image loading on mobile and web platforms.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_cache_manager

More

Packages that depend on flutter_network_image