flutter - Restarting WebP animation to first frame in Flutter
问题描述
Is there a way to force a restart on an WebP animation?
After flutter engine added WebP support (https://github.com/flutter/flutter/issues/9857) I am able to loop a single animation.webp file successfully forever.
I want to restart the animation.webp animation for every onTouch() event of a widget.
I have a custom Visibility wrapper widget that properly continues the animation from the point it is hidden and becomes visible again, but the looping and timing does not work out perfectly all the time.
Have a feeling I may need to modify the flutter engine to support this.
解决方案
能够通过执行 ImageWithWebPAsset.image.evict() 重新启动动画
推荐阅读
- python - 第 6 行,在
get_ipython().run_line_magic('matplotlib', 'inline') AttributeError: 'NoneType' 对象没有属性 'run_line_magic' - c# - C# 等价于?
- php - 按下按钮不起作用时删除行
- prisma - 为什么“...WhereInput”中不再有“OR”运算符?(棱镜 1.25.4)
- php - 如何检查产品是否由woocommerce中的用户创建
- django - Django rest 框架极慢(递归关系)
- node.js - Windows 10 上的 Meteor 构建失败 - 进程内存不足
- javascript - 按类获取节点的子节点(HTML 模板)
- python - 即使在应用 fillna() 之后,Pandas GroupBy STDEV 也会返回 NaN
- d3.js - 如何计算 D3 v5 中的节点度?