saka_image 0.0.2 copy "saka_image: ^0.0.2" to clipboard
saka_image: ^0.0.2 copied to clipboard

outdated

Simple placeholder image

saka_image #

A flutter image widget,can use placeholder before loading net_image, also can show an error image if there is something wrong with the image url

Getting Started #

just like use Image.network

SakaImage.urlWithPlaceHolder(
  "http://img.rangaofei.cn/01b18.jpg",
  prePlaceHolder: "images/test.gif",
  errPlaceHolder: "images/error.jpeg",
  preDuration: Duration(seconds: 10),
);

prePlaceHolder is used before load the net image

errPlaceHolder is user when the url not correct

preDuration is the prePlaceHolder show duration at least

other property is just like Image

  1. with no duration,when the net image get completed, the pre placeholder will be placed immediately.
SakaImage.urlWithPlaceHolder(
  "http://img.rangaofei.cn/01b18.jpg",
  errPlaceHolder: "images/error.jpeg",
  prePlaceHolder: "images/splash.jpg",
  fit: BoxFit.cover,
);
  1. with duration,when the net image get completed before the duration, the placeholder will not be placed until the duration.
SakaImage.urlWithPlaceHolder(
  "http://img.rangaofei.cn/01b18.jpg",
  errPlaceHolder: "images/error.jpeg",
  prePlaceHolder: "images/splash.jpg",
  preDuration: Duration(seconds: 5),
  fit: BoxFit.cover,
);
  1. if the url is not reachable or error, this will be replaced by the error.jpeg
SakaImage.urlWithPlaceHolder(
  "http://img.rangaofei.cn/01b18.jp",//errorr
  errPlaceHolder: "images/error.jpeg",
  prePlaceHolder: "images/splash.jpg",
  preDuration: Duration(seconds: 5),
  fit: BoxFit.cover,
);

the placeholder must be an assets url

1
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Simple placeholder image

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on saka_image