Coder Social home page Coder Social logo

flutter_ok_image's Introduction

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.

ok_image pub package GitHub GitHub stars

use

  1. add to your pubspec.yaml
ok_image: ^0.4.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

under BSD 3:

  1. This library uses http 0.12.0+2 as a framework for network access.
  2. using path_provider 1.2.0 to get default catch path.
  3. using crypto 2.0.6 to make and check md5.

Apache 2.0:

  1. Using rxdart 0.22.1 processing logic

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.

flutter_ok_image's People

Contributors

caijinglong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

flutter_ok_image's Issues

兼容 rxdart ^0.20.0

Because every version of ok_image depends on rxdart ^0.19.0 and flutter_app depends on rxdart ^0.20.0, ok_image is forbidden.
So, because flutter_app depends on ok_image ^0.1.1, version solving failed.

pub get failed (1)

CircularProgressIndicator on Android

On Android, the CircularProgressIndicator fills all the size of my image.. It should be better that it just shows a small progress at the center of the image. On iOS it worked well.
I saw that I can use the loadingWidget to customize that, but it should worked by default.
Another problem is that I can't disable the progress, because if I set the loadingWidget to null, it gets the defaults.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.