ok_image 0.3.0

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

OKImage #

Easy to use this library to build a network image widget, you can build different layouts according to the error/load, also set up the image cache delegate.

pub package GitHub GitHub stars

use #

  1. add to your pubspec.yaml
ok_image: ^0.3.0
  1. import
import "package:ok_image/ok_image.dart";
  1. use
import "package:ok_image/ok_image.dart";
createWidget(){
  return OKImage(
      url: "https://ws1.sinaimg.cn/large/844036b9ly1fxfo76hzd4j20zk0nc48i.jpg",
      width: 200,
      height: 200,
      timeout: Duration(seconds: 20),
      fit: fit,
    );
}
  1. params
url: image net url
width: width
height: height
fit: show BoxFit
followRedirects: whether image redirection is allowed.
loadingWidget: display on loading
errorWidget: display when image load error / timeout.
retry: retry to load image count.
timeout: timeout duration.
onErrorTap: when loadErrorWidget show ,onTap it.
cacheDelegate: you can use the param to delegate loadImage

Experimental: Signatures, return values, parameters and other information may be modified in the future.

onLoadStateChanged: will be call on the load state changed.
  1. global config

edit OKImage.buildErrorWidget to config global OKImage errorWidget.

edit OKImage.buildLoadingWidget to config global OKImage loading.

about other library #

This library uses http 0.12.0 as a framework for network access.
Using rxdart 0.20.0 processing logic

using path_provider 0.4.1 to get default catch path. using crypto 2.0.6 to make and check md5.

thanks to open source.

If you are using older versions of these open source libraries, which cause incompatibility, please update your. If it is incompatible with me, please contact me and I will update the version number when appropriate.

CHANGELOG #

[0.3.0] upgrade path_provider

breaking change because path_provider migrate from android support to androidX, so your other plugin also need be migrated. upgrade rxdart

[0.2.3] add remove cache

ImageCache.removeCache(String url);

[0.2.2] request

add a parameter to delete the cache whose last access time exceeds duration

add onImageLoadState callback

[0.2.1] un-ext image load error

Fix: Unextended images cannot be loaded

[0.2.0]

global error and loading widget

add a clear cache method

upgrade rxdart version

fix bug for downloading

[0.1.1] fix load bug

fix error bug

[0.1.0] update request and cache

Now the same URL will share a download, waiting for the download to complete and return together.

+1 #

update readme

[0.0.3] add cache delegate

add a default cache delegate to cache image

[0.0.2] ADD LICENSE

use MIT

[0.0.1] first version

example/README.md

example #

A new Flutter project.

Getting Started #

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

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


dependencies:
  ok_image: ^0.3.0

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:ok_image/ok_image.dart';
  
Version Uploaded Documentation Archive
0.3.0 Feb 21, 2019 Go to the documentation of ok_image 0.3.0 Download ok_image 0.3.0 archive
0.2.3 Feb 2, 2019 Go to the documentation of ok_image 0.2.3 Download ok_image 0.2.3 archive
0.2.2 Jan 21, 2019 Go to the documentation of ok_image 0.2.2 Download ok_image 0.2.2 archive
0.2.1 Jan 4, 2019 Go to the documentation of ok_image 0.2.1 Download ok_image 0.2.1 archive
0.2.0 Dec 27, 2018 Go to the documentation of ok_image 0.2.0 Download ok_image 0.2.0 archive
0.1.1 Dec 25, 2018 Go to the documentation of ok_image 0.1.1 Download ok_image 0.1.1 archive
0.1.0+1 Dec 21, 2018 Go to the documentation of ok_image 0.1.0+1 Download ok_image 0.1.0+1 archive
0.1.0 Dec 21, 2018 Go to the documentation of ok_image 0.1.0 Download ok_image 0.1.0 archive
0.0.3 Nov 27, 2018 Go to the documentation of ok_image 0.0.3 Download ok_image 0.0.3 archive
0.0.2 Nov 22, 2018 Go to the documentation of ok_image 0.0.2 Download ok_image 0.0.2 archive

All 11 versions...

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

We analyzed this package on Apr 16, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14
  • Flutter: 1.4.7

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
crypto ^2.0.6 2.0.6
flutter 0.0.0
http ^0.12.0+1 0.12.0+2
path_provider ^0.5.0+1 0.5.0+1
rxdart ^0.21.0 0.21.0
Transitive dependencies
async 2.2.0
charcode 1.1.2
collection 1.14.11
convert 2.1.1
http_parser 3.1.3
meta 1.1.6 1.1.7
path 1.6.2
pedantic 1.5.0
sky_engine 0.0.99
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test