GifView
加载 GIF 图片并可以设置帧率
功能
使用 GifView,您可以轻松加载 GIF 图片并配置帧率。
- 从
Assets加载; - 从
Network加载; - 从
Memory加载; - 设置帧率;
- 监听动画开始 (
onStart)、帧变化 (onChange) 和结束 (onFinish)。 - 加载 GIF 时设置
progress
入门
在您的 pubspec.yaml 文件中将 gif_view 添加为 依赖项。
用法
从 Asset 加载 GIF
GifView.asset(
'assets/gif1.gif',
height: 200,
width: 200,
frameRate: 30, // default is 15 FPS
)
从 Network 加载 GIF
GifView.network(
'https://www.showmetech.com.br/wp-content/uploads/2015/09/happy-minion-gif.gif',
height: 200,
width: 200,
)
从 Memory 加载 GIF
GifView.memory(
_bytes,
height: 200,
width: 200,
)