Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add onComplete callback to AnimationWidget #2515

Merged
merged 7 commits into from
May 1, 2023

Conversation

willhlas
Copy link
Contributor

Description

Adds optional onComplete callback to SpriteAnimationWidget for asset constructor.

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • [-] I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • [-] I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

@willhlas willhlas changed the title feat(animation_widget): add onComplete callback feat(animation_widget): Add onComplete callback Apr 20, 2023
Copy link
Member

@erickzanardo erickzanardo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@erickzanardo erickzanardo requested review from a team, st-pasha and ufrshubham April 20, 2023 12:25
Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some small nits, the idea is good!

packages/flame/lib/src/widgets/animation_widget.dart Outdated Show resolved Hide resolved
packages/flame/lib/src/widgets/animation_widget.dart Outdated Show resolved Hide resolved
Copy link
Member

@ufrshubham ufrshubham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how useful the other callbacks will be in this widget, but it sure would look more complete if onStart and onFrame are exposed too. Anyways, current changes look fine to me 👍🏼

@erickzanardo
Copy link
Member

Not sure how useful the other callbacks will be in this widget, but it sure would look more complete if onStart and onFrame are exposed too. Anyways, current changes look fine to me 👍🏼

Yeah, good call. I think we should expose either way, there may always have a use case that we can't see right away.

I would argue that we should do each callbacks in a separate PR, wdyt?

@ufrshubham
Copy link
Member

I would argue that we should do each callbacks in a separate PR, wdyt?

Yeah, separate PR is fine. Definitely don't want to ask too many additional changes from new contributors 😄.

@spydon spydon changed the title feat(animation_widget): Add onComplete callback feat: Add onComplete callback to AnimationWidget May 1, 2023
@spydon spydon enabled auto-merge (squash) May 1, 2023 16:45
@spydon spydon merged commit 0b68be8 into flame-engine:main May 1, 2023
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.

6 participants