耀斑颤振动画



我正在尝试调用动画(我得到了(,但我希望它在完成后转发到另一个页面。如何执行路由系统或如何使动画完成并调用另一个屏幕?

return Scaffold(
body: Stack(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
width: 400,
height: 400,
alignment: Alignment.center,
child: FlareActor(
"assets/animations/LoadingM.flr",
alignment: Alignment.center,
fit: BoxFit.contain,
color: Colors.blue,
animation: _animationL,
),
),
],
)
],
)
],
),
);
}
}

这非常简单,您只需将回调属性添加到 FlareActor。

return Scaffold(
body: Stack(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
width: 400,
height: 400,
alignment: Alignment.center,
child: FlareActor(
"assets/animations/LoadingM.flr",
alignment: Alignment.center,
fit: BoxFit.contain,
color: Colors.blue,
animation: _animationL,
callback: (String animationName) {
//Navigate to new page here
//hint: the animationName parameter tells you the name
//      of the animation that finished playing
},
),
),
],
)
],
)
],
),
);

最新更新