我现在开发了一个应用程序,在颤振网络中使用相同的动画。但它的抛出错误。我已经下载了flutter的二进制文件并将其提供给flare,但它不起作用。相同的代码在android中运行良好,但在flutter web Plzz帮助中抛出错误。错误:
Error: [object Event]
at Object.createErrorWithStack (http://localhost:62576/dart_sdk.js:4789:12)
at Object._rethrow (http://localhost:62576/dart_sdk.js:35903:16)
at async._AsyncCallbackEntry.new.callback
(http://localhost:62576/dart_sdk.js:35899:13)
at Object._microtaskLoop (http://localhost:62576/dart_sdk.js:35759:13)
at _startMicrotaskLoop (http://localhost:62576/dart_sdk.js:35765:13)
at http://localhost:62576/dart_sdk.js:31707:9
代码:
class Home extends StatefulWidget {
@override
_HomeState createState() => _HomeState();
}
class _HomeState extends State<Home> {
String animationName = "forward";
bool paused;
@override
void initState() {
// TODO: implement initState
super.initState();
animationName = "forward";
paused = false;
}
@override
Widget build(BuildContext context) {
return Container(
child: FlareActor(
"flare_truck.flr",
animation: animationName,
fit: BoxFit.fitHeight,
alignment: Alignment(0, 0),
callback: (str) {
setState(
() {
animationName = "upDown";
},
);
},
),
);
}
}