【发布时间】:2022-10-23 17:13:57
【问题描述】:
我有一个非常简单的动画,用于我在 Adobe After Effects 中制作并通过 LottieFiles 扩展名将其导出为 json 的摇动 jar 的闪屏,它工作正常,但是当我打开应用程序时每隔几次动画就会出现故障(见下图),我想不通,并尝试寻找解决方案但没有成功。问题是故障是随机发生的(有时当我打开应用程序时会连续发生几次,有时是每 x 次)。这是在多个安卓设备上测试的,结果相同。
启动画面代码:
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: isDarkMode()? const Color(0xFF31302f) : const Color(0xFFfcfaf6),
body:
Align(
alignment: Alignment.topCenter,
child: Column(
children: [
SizedBox(height: height(context)*0.08),
Stack(
children: [
Image.asset(
isDarkMode()? 'assets/crnikruh.png' : 'assets/bijelikruh.png',
height: height(context)*0.3,
width: height(context)*0.3,
),
Padding(
padding: EdgeInsets.only(top: height(context)*0.01),
child: Lottie.asset(
'lottie/jaranimation.json',
width: height(context)*0.3,
height: height(context)*0.3,
frameRate: FrameRate.max,
fit: BoxFit.fill,
),
)
],
),
],
),
),
);
}
}
【问题讨论】:
标签: android flutter dart lottie