Skip to content

Update jumping_dots.dart#1

Open
ukasz123 wants to merge 2 commits into
wal33d006:masterfrom
ukasz123:master
Open

Update jumping_dots.dart#1
ukasz123 wants to merge 2 commits into
wal33d006:masterfrom
ukasz123:master

Conversation

@ukasz123
Copy link
Copy Markdown

Animate dots using single AnimationController

Animate dots using single AnimationController
@ukasz123
Copy link
Copy Markdown
Author

I believe using single AnimationController and SingleTickerProviderStateMixin may improve animation performance. What do you think?

@wal33d006
Copy link
Copy Markdown
Owner

The animation became cool, but my idea was to animate the next dot when the previous one is half way, therefore I used TickerProvider instead of SingleTicker provider. We can see what can be done to retain my idea and make the animations smoother. Thanks btw!

@ukasz123
Copy link
Copy Markdown
Author

I think that effect can be achieved by playing with the _generateDotAnimation() function. You can adjust starting time of jump and fall animations there.

@wal33d006
Copy link
Copy Markdown
Owner

We need more than one animation controller for that I guess. Or maybe I am wrong. To give the wave a helix type animation, each of the previous dot needs to be animated before the next dot's animation is completed. If that can be done in _generateDotAnimation by any means, that would be great!

@ukasz123
Copy link
Copy Markdown
Author

I hope I've done math right. Check jumping_dots.dart lines 84 and following. I added _jumpDelay constant that controls the relative delay between jumps. 1.0 - each dot jumps just after previous lands, 0.0 - all dots jumps together.

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