-
Notifications
You must be signed in to change notification settings - Fork 222
Closed
Labels
Description
I am using rive: 0.14.0-dev.8, and the RiveWidget works well.
My question is, how do I know the riv file has finished playing or if I want the riv file plays in a loop what should I do? With rive: 0.13 I can use stateMachineController.isActiveChanged.addListener(() {}) to do something.
The code is simply as follows and the controller's listener never get called.
@override
void initState() {
super.initState();
var file = await File.path(somePath, riveFactory: Factory.rive);
_controller = RiveWidgetController(file!);
_controller!.addListener(() {
/// never get called
print('${_controller!.active}');
});
setState(() {
_isInitialized = true;
});
}
@override
Widget build(BuildContext context) {
if (!_isInitialized) {
return CupertinoActivityIndicator();
}
return RiveWidget(controller: _controller!);
}
Thanks for your help!