Skip to content

Flutter network image provider with caching and retry support

Notifications You must be signed in to change notification settings

alim-zanibekov/advanced_image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

advanced_image

Flutter network image provider with caching and retry support

Example

import 'package:advanced_image/provider.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(App());
}

class App extends StatefulWidget {
  @override
  _AppState createState() => _AppState();
}

class _AppState extends State<App> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Advanced image example'),
        ),
        body: Center(
          child: Image(
            image: AdvancedNetworkImage(
              'https://i.imgur.com/Uschheg.jpeg',
              headers: {
                'X-Auth': 'bla-bla',
              },
              retryOptions: RetryOptions(
                  delayFactor: Duration(milliseconds: 100),
                  maxDelay: Duration(seconds: 10),
                  randomizationFactor: 0.2,
                  maxAttempts: 4),
            ),
          ),
        ),
      ),
    );
  }
}

About

Flutter network image provider with caching and retry support

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published