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

flutter_gif 封面
插件详情v0.0.4

flutter_gif

GIF 图像小部件,帮助控制 GIF 进度、速度和重复帧。

近 30 天下载
669
喜欢数
56
Pub 分数
70

安装插件

flutter pub add flutter_gif

插件介绍

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

flutter_gif 包为 Flutter 应用程序提供了一个用于显示和控制 GIF 动画的组件。它允许对 GIF 播放进行精细控制,包括进度、速度和帧重复。适用于需要动态、交互式动画内容的应用程序,支持流畅渲染和高效的内存使用。该包设计轻量且易于集成,适用于简单和复杂的动画需求。

适合场景

  • 显示动画横幅
  • 创建交互式加载指示器
  • 通过动态视觉效果增强用户界面
  • 实现自定义 GIF 播放器
  • 为应用元素添加有趣的动画

主要特点

  • GIF 播放速度的控制
  • 可调节的动画进度
  • 帧重复设置
  • 轻量且高效的渲染
  • 与现有 Flutter 项目的简单集成

适合对象

  • 开发媒体丰富的应用程序的开发者
  • 需要动画元素的UI设计师
  • 需要可自定义GIF的应用程序
  • 专注于性能和流畅动画的项目

使用建议

  • 仅限 GIF 格式
  • 不支持其他动画格式
  • 可能需要对大型 GIF 进行优化
  • 平台特定的行为可能会有所不同

原始 README

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

flutter_gif

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_gif: any // or the latest version on Pub

simple usage

    FlutterGifController controller= FlutterGifController(vsync: this);


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

list the most common operate in FlutterGifController:

// loop from 0 frame to 29 frame
controller.repeat(min:0, max:29, period:const 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"));

Support the package (optional)

If you find this package useful, you can support it for free by giving it a thumbs up at the top of this page. Here's another option to support the package:

Thanks

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.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。