-
Notifications
You must be signed in to change notification settings - Fork 86
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
Add TweenSequenceEffect + test #38
base: main
Are you sure you want to change the base?
Conversation
Just spit balling... We could further reduce this by providing some syntax sugar for TweenSequence<double>([
TweenSequenceItem(tween: ..., weight: 1)
] Could default to begin/end to 0/1, and weight to 1. Going from this: sequence: TweenSequence<double>([
TweenSequenceItem(tween: Tween(begin: 0, end: 1), weight: .5),
TweenSequenceItem(tween: Tween(begin: 1, end: 0), weight: .5),
TweenSequenceItem(tween: Tween(begin: 0, end: 1), weight: .5),
]), to: items: <double>[
EffectSequenceItem(),
EffectSequenceItem(begin: 1, end: 0),
EffectSequenceItem(),
]), Not sure it's worth the lift / abstraction layer, just a thought. The more verbose style is more flexible, as [Edit] Thinking about it more, I think taking the entire |
Thoughts on just adding this to sequence?.evaluate(animation.value) ?? animation.value |
I think I would slightly prefer the better semantics of seeing One concrete benefit of this is that with So it kinda reads a little better but is also just a little more robust / strict |
I don't have a strong opinion from a semantics perspective, but it's one less Effect class to maintain and update. :) |
Yep. My preference would be to take the hit on the maintenance side, and have the better semantics, but all good either way. They certainly are very similar classes. Just lmk what direction you want to go in. |
What this does
Allows users to more seamlessly use Flutters built in
TweenSequence
API to express complex multi-step tweens.Currently using
TweenSequence
is possile using aCustomEffect
but requires slightly more boilerplate.Why use a TweenSequence
delay
s and usingthen()
, or manually making calls on the animation controller), which may be easier to read and maintainthen
ordelay
approach.