搜索插件、代码仓与 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.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。