搜尋套件、儲存庫與 APP 分類

套件詳情v1.0.1

flutter_gifimage

一個用於 Flutter 的 GIF 圖像,解決 GIF 無法控制速度、進度的問題

近 30 天下載
467
喜歡數
63
Pub 分數
40

安裝套件

flutter pub add flutter_gifimage

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個 Flutter 套件,可對 GIF 動畫實現精確控制,解決標準 GIF 處理中的限制,例如固定播放速度和缺乏進度追蹤。它允許開發者播放、暫停、重新開始和尋找 GIF 中的任意位置,提供更具互動性的體驗。此套件專為無縫整合至 Flutter 應用程式而設計,支援自訂動畫行為。以效能與易用性為核心打造,透過動態影像內容提升使用者參與度。

適用情境

  • 互動式應用程式圖示
  • 帶有自定進度的加載指示器
  • 動畫教程
  • 遊戲化UI元素
  • 自定義GIF播放器

主要特色

  • 播放、暫停和重新啟動 GIF
  • 定位到特定幀或時間
  • 調整播放速度
  • 支援漸進式載入
  • 可自定義的動畫行為

適合對象

  • 需要細粒度 GIF 控制的開發者
  • 需要動畫UI組件的應用程式
  • 帶有互動式媒體元素的專案
  • 教育類或遊戲化應用
  • 高性能動畫需要

使用建議

  • 可能會增加大型 GIF 的記憶體使用量
  • 需要仔細管理動畫生命週期
  • 未經優化,不適合非常長或複雜的GIF
  • 有限的平台特定優化
  • 依賴外部庫進行解碼

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

flutter_gifimage

We should know that in order to achieve Gif in flutter, we can use Image, but we have no way to manipulate Gif, for example: change its speed, control it has been playing in a frame, in which frame range loop. These problems can be solved by this widget,it also help you contain gif cache,avoid load frame every time.

Screenshots

Usage(Simple)

add in pubspec


     flutter_gifimage: ^1.0.0

simple usage

    GifController controller= GifController(vsync: this);


    GifImage(
         controller: controller,
         image: AssetImage("images/animate.gif"),
    )

list the most common operate in GifController:

// loop from 0 frame to 29 frame
controller.repeat(min:0,max:29,period:Duration(millseconds:300));

// jumpTo thrid frame(index from 0)
controller.value = 0;

// from current frame to 26 frame
controller.animateTo(26);

If you need to preCache gif,try this

// put imageProvider
fetchGif(AssetImage("images/animate.gif"));

Thanks

  • gif_ani (thanks for giving me idea)

License

MIT License

Copyright (c) 2019 Jpeng

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。