搜尋套件、儲存庫與 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 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。