搜索插件、代码仓与 APP 分类

fancy_shimmer_image 封面
插件详情v2.0.3

fancy_shimmer_image

一个用于轻松使用图片的包,这些图片会自动缓存,并且在加载时具有漂亮的动态(但可配置)闪烁效果

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
3320
喜欢数
219
Pub 分数
140

安装插件

flutter pub add fancy_shimmer_image

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个 Flutter 包,可简化加载图像,加载时内置闪烁效果,提升用户体验。它自动处理图像缓存,并支持多种图像源,包括 URL 和资源文件。闪烁效果可自定义,允许开发者调整颜色、持续时间和动画样式。非常适合用于异步加载图像的列表视图和网格中,以提高感知性能。

适合场景

  • 在可滚动列表中加载图像
  • 在网格布局中显示占位符效果
  • 增强图像加载期间的UI反馈
  • 在图像密集型界面中创建流畅的过渡效果
  • 提高网络依赖应用的感知性能

主要特点

  • 自动图像缓存
  • 可配置的闪烁动画
  • 支持网络和资产镜像
  • 可自定义的闪烁颜色和持续时间
  • 内置的加载失败回退
  • 轻量且易于集成

适合对象

  • 寻求快速图像占位符的开发者
  • 高频图像加载的应用
  • UI设计师专注于视觉打磨
  • 项目需要最少的样板代码来加载图像
  • 在异步操作期间优先考虑用户体验的团队

使用建议

  • 可能会略微增加初始包大小
  • 闪烁效果可能不适合所有设计主题
  • 需要互联网访问以加载远程图像
  • 超出基本动画设置的自定义功能有限
  • 未针对没有额外处理的大型图像集合进行优化

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Buy Me A Coffee

Introduction

Package created for the purpose of uploading images from the internet, giving the possibility of showing a beautiful Shimmer animation while the images are not loading. And it is still possible to create a widget to be shown in case the image upload fails for some reason.

This package is basically a union of two known packages:

Basic Usage

You can use the package on the fly by simple passing a URL of an image to the FancyShimmerImage widget.

FancyShimmerImage(  
  imageUrl: 'https://images.unsplash.com/photo-1465572089651-8fde36c892dd?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&w=1000&q=80',  
),

That will produce a image that's is cacheable by default and that has a default (grey) Shimmer animation. Similar to result below:

enter image description here

More Advanced Usage

If you don't like the default widget behavior, you can set the background colors of the image, the color of the shimmer base effect, and the color of the highlighted effect.

FancyShimmerImage(  
  imageUrl: 'https://static.businessinsider.sg/2018/12/12/5c1c90f8e04d6243c7019cf6.png',  
  shimmerBaseColor: randomColor(),  
  shimmerHighlightColor: randomColor(),  
  shimmerBackColor: randomColor(),  
)

By randomizing the colors you can have a result similar to this:

enter image description here

Other thing you can do is to configure the direction of the Shimmer and it's speed. In the above example i configured it to have top to bottom direction and 300 milliseconds of speed.

enter image description here

One last step you can configure is to configure the widget that will appear in case the image upload fails for some reason. In this case just pass the desired widget in the errorWidget parameter. If no value is passed, a default error widget will be used.

FancyShimmerImage(  
  imageUrl: 'https://static.businessinsider.sg/2018/12/12/5c1c90f8e04d6243c7019cf6.png',  
  errorWidget: Image.network('https://i0.wp.com/www.dobitaobyte.com.br/wp-content/uploads/2016/02/no_image.png?ssl=1'),
)

enter image description here

所属分类

依赖

依赖清单 2 项

源码仓库

使用此插件的项目

暂无相关数据。