-
Notifications
You must be signed in to change notification settings - Fork 29.1k
Add a TweenAnimationBuilder.repeat
API
#174014
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
base: master
Are you sure you want to change the base?
Conversation
53cabd8
to
3dcc5eb
Compare
/// Unlike the default constructor, [onEnd] is not supported for repeating | ||
/// animations since they never end. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I'd consider dropping this line - calling out something that's not present might confuse users.
/// * [AnimationController.repeat], which this constructor replaces for simple use cases. | ||
/// * [TweenAnimationBuilder], the default constructor for single animations. | ||
/// | ||
/// ## Ownership |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move the Ownership section up above the code samples?
/// ## Ownership | ||
/// | ||
/// The [TweenAnimationBuilder] takes full ownership of the provided [tween] | ||
/// instance and mutates it. Once a [Tween] has been passed to a | ||
/// [TweenAnimationBuilder], its properties should not be accessed or changed | ||
/// anymore to avoid interference with the [TweenAnimationBuilder]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This content mirrors but is slightly different from the "Ownership of the Tween" content on TweenAnimationBuilder. I'd consider making a template out of the original content and just use the template here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the issue of making a template (now) where it is a separate component is that I can't repeat "The [TweenAnimationBuilder] takes full ownership" unless it accepts variable so might make sense to repeat now :( or just omit or duplicate.
bool paused = false, | ||
required this.builder, | ||
this.child, | ||
}) : _isRepeating = true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oof.. This is not as nice as I had hoped. Maybe this would be better as a separate RepeatedTweenAnimationBuilder
widget?
dee8e52
to
6a1920f
Compare
Migrate examples more
fix typo More fixes
Implements / Close #174011
Probably there are 400 LOC of comments + tests, so this removes more code than adds.