Flare Flutter Анимация
Я пытаюсь вызвать анимацию (которую я получил), но я хочу, чтобы после финализации я перешел на другую страницу. Как мне сделать систему маршрутизации или как заставить анимацию завершиться и вызвать другой экран?
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,
),
),
],
)
],
)
],
),
);
}}
0 ответов
Это действительно просто, вы просто добавляете свойство обратного вызова в свой 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
},
),
),
],
)
],
)
],
),
);