Closed jcairo closed 4 years ago
Hi @jcairo! That does seem strange. Can you post the matching .flr file? If it's private, could you email it to me at luigi@rive.app? I'll follow up here with findings!
Hey @luigi-rosso! Thanks for the quick reply.
File and link attached.
I see what happened!
You're inheriting from FlareController with the implements keyword which requires you to implement everything yourself (including the ValueNotifier<bool> isActive = ValueNotifier<bool>(true);
which isn't initialized in your code).
Easy fix is to change it to a mixin and remove the ValueNotifier in your code:
Change definition to mixin:
class _SubUnsubButtonState extends State<SubUnsubButton>
with TickerProviderStateMixin, FlareController {
Delete this:
@override
ValueNotifier<bool> isActive;
Hey @luigi-rosso!
That was it! Works perfect.
When I return false from the advance function it appears its never called again.
Is there a way to get the advance function to rerun again after false is returned? Is it bad practise to always return true?
Thanks again for the help. Much appreciated.
Great! Yes, you can reactivate the controller by setting isActive.value = true.
Perfect!
Hi guys. Thanks for the great tool.
I'm working on a Flutter animation that requires a portion of the animation to be replayed while a network request is made. From my understanding this requires a custom controller.
I'm trying to create a basic custom controller to get started but I'm having issues with the advance method.
It seems as though although I always return true from the method, its only called for the first render of the widget its contained in. Any idea why this would be?