Skip to content

Conversation

@saepire
Copy link

@saepire saepire commented Aug 11, 2024

This breaks while building with latest flutter. Likely due to the toggle addition in flutter/flutter#147801

trying to fix.

This breaks while building with latest flutter. Likely due to the toggle addition in flutter/flutter#147801

trying to fix.
@nikodembernat
Copy link
Owner

nikodembernat commented Aug 11, 2024

Thanks for noticing it!
I see that you are missing @override and don't return TickerFuture when calling forward - it would be better to return it because it accurately shows the current state of the animation. Do you want to fix it or should I do it?

Also, it would be a good idea to simplify this method while we are editing it.

Basically, we need something like:

@override
TickerFuture toggle({double? from}) {
  if (isCompleted) {
    reset();
  } else if (_isPlaying) {
    stop();
    return TickerFuture.complete();
  }

  return forward(from: from);
}

I can make a new release today if we merge it

@nikodembernat
Copy link
Owner

Ok, I've fixed it, I won't waste your time.
Thanks a lot nonetheless!

There should be a new release later today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants