flutter_advanced_networkimage 0.2.8

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 94

Flutter Advanced Network Imageprovider

pub package

An advanced image provider provides caching and retrying for flutter app. Now with zoomable widget and transition to image widget.

Getting Started

Installation

Add this to your pubspec.yaml (or create it):

dependencies:
  flutter_advanced_networkimage: any

Then run the flutter tooling:

flutter packages get

Example

// using image provider
Image(
  image: AdvancedNetworkImage(url, header: header, useDiskCache: true),
  fit: BoxFit.cover,
)
// get the disk cache folder size
int folderSize = await getDiskCachedImagesSize();
// clean the disk cache
bool isSucceed = await clearDiskCachedImages();
// using zooming widget & transitiontoimage widget
ZoomableWidget(
  minScale: 0.3,
  maxScale: 2.0,
  // default factor is 1.0, use 0.0 to disable boundary
  panClampFactor: 0.8,
  child: Container(
    child: TransitionToImage(
      AdvancedNetworkImage(url, timeoutDuration: Duration(minutes: 1)),
      // This is the default placeholder widget at loading status,
      // you can write your own widget with CustomPainter.
      placeholder: CircularProgressIndicator(),
      // This is default duration
      duration: Duration(milliseconds: 300),
      fallbackWidget: DecoratedBox(...),
    ),
  ),
)
// using reload feature(you can use a `GestureDetector`
// widget to wrap `TransitionToImage` widget)
TransitionToImage imageWidget = TransitionToImage(
  AdvancedNetworkImage(url),
  useReload: true,
  reloadWidget: Icon(Icons.replay),
);
ZoomableWidget(
  minScale: 0.3,
  maxScale: 2.0,
  child: imageWidget,
  tapCallback: imageWidget.reloadImage,
),

Details in example/ folder.

demo gif

Changelog

[0.2.8]

  • ZoomableWidget support boundary for now.

[0.2.7]

  • Drop support for ETag checking.

[0.2.6]

  • Fix an issue that causes a ConcurrentModificationError.

[0.2.5]

  • Move the cache files from app folder to temporary folder.

[0.2.4]

  • Add reloadWidget and fallbackWidget to TransitionToImage widget.

[0.2.3]

  • Add a minimum png to avoid some issues.
  • Add a reload button to TransitionToImage widget to reload the image if fetching network image failed.

[0.2.2+1]

  • Update some dependencies.

[0.2.2]

  • Adapt to dart 2 preview.

[0.2.1]

  • Support fallback image after retrying failed.

[0.2.0+1]

  • Cleanup example code.

[0.2.0]

  • Add timeoutDuration parameter, make some tweaks and add some doc comments to AdvancedNetworkImage imageprovider.

  • Make some tweaks for TransitionToImage widget.

  • Fix the panning issue which would shift when the scale is not 1.0 for ZoomableWidget.

[0.1.10]

  • Catch exception for file not found.

[0.1.9]

  • Add default blendmode to TransitionToImage widget.

[0.1.8]

  • Fix the listener leak problem for the TransitionToImage widget.

[0.1.7]

  • Add a TransitionToImage Widget, optimize ZoomableWidget and update example.

[0.1.6+2]

  • Downgrade http version.

[0.1.6+1]

  • Upgrade the dart SDK version.

[0.1.6]

  • Add animation to ZoomableWidget.

[0.1.5]

  • Update ZoomableWidget.

[0.1.4]

  • Update example.

[0.1.3]

  • Fix dependencies with http package.

[0.1.2]

  • Upgrade some dependencies version.

[0.1.1]

  • Downgrade some packages version.

[0.1.0]

  • An advanced image provider and a widget with zooming and panning.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_advanced_networkimage/flutter_advanced_networkimage.dart';
import 'package:flutter_advanced_networkimage/zoomable_widget.dart';
import 'package:flutter_advanced_networkimage/transition_to_image.dart';

main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    TransitionToImage imageWidget = TransitionToImage(
      AdvancedNetworkImage(
        'https://assets-cdn.github.com/images/modules/logos_page/GitHub-Mark.png',
      ),
      useReload: true,
    );

    return MaterialApp(
      title: 'Flutter Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: Text('Flutter Advanced Network Image Example'),
        ),
        body: ZoomableWidget(
          minScale: 0.3,
          maxScale: 2.0,
          child: imageWidget,
          tapCallback: imageWidget.reloadImage,
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_advanced_networkimage: "^0.2.8"

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


      import 'package:flutter_advanced_networkimage/flutter_advanced_networkimage.dart';
  
Version Uploaded Documentation Archive
0.2.8 Jun 17, 2018 Go to the documentation of flutter_advanced_networkimage 0.2.8 Download flutter_advanced_networkimage 0.2.8 archive
0.2.7 Jun 3, 2018 Go to the documentation of flutter_advanced_networkimage 0.2.7 Download flutter_advanced_networkimage 0.2.7 archive
0.2.6 Jun 3, 2018 Go to the documentation of flutter_advanced_networkimage 0.2.6 Download flutter_advanced_networkimage 0.2.6 archive
0.2.5 May 24, 2018 Go to the documentation of flutter_advanced_networkimage 0.2.5 Download flutter_advanced_networkimage 0.2.5 archive
0.2.4 Apr 20, 2018 Go to the documentation of flutter_advanced_networkimage 0.2.4 Download flutter_advanced_networkimage 0.2.4 archive
0.2.3 Apr 17, 2018 Go to the documentation of flutter_advanced_networkimage 0.2.3 Download flutter_advanced_networkimage 0.2.3 archive
0.2.2+1 Apr 7, 2018 Go to the documentation of flutter_advanced_networkimage 0.2.2+1 Download flutter_advanced_networkimage 0.2.2+1 archive
0.2.2 Mar 27, 2018 Go to the documentation of flutter_advanced_networkimage 0.2.2 Download flutter_advanced_networkimage 0.2.2 archive
0.2.0+2 Mar 11, 2018 Go to the documentation of flutter_advanced_networkimage 0.2.0+2 Download flutter_advanced_networkimage 0.2.0+2 archive
0.2.0+1 Mar 11, 2018 Go to the documentation of flutter_advanced_networkimage 0.2.0+1 Download flutter_advanced_networkimage 0.2.0+1 archive

All 24 versions...

Analysis

We analyzed this package on Jun 17, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.60.0
  • pana: 0.11.3
  • Flutter: 0.5.2

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
87 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
94
Learn more about scoring.

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Suggestions

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 1 hint.

    Run flutter format to format lib/flutter_advanced_networkimage.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0
crypto ^2.0.3 2.0.5
flutter 0.0.0
http ^0.11.3 0.11.3+16
path ^1.5.1 1.6.0 1.6.1
path_provider ^0.4.0 0.4.1
quiver >=0.29.0 <0.30.0 0.29.0+1
Transitive dependencies
async 2.0.7
charcode 1.1.1
collection 1.14.6 1.14.10
convert 2.0.1
http_parser 3.1.2
matcher 0.12.3
meta 1.1.5
sky_engine 0.0.99
source_span 1.4.0
stack_trace 1.9.2
string_scanner 1.0.2
typed_data 1.1.5
vector_math 2.0.6 2.0.7