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

TikTok UI Tutorial Video Description "Marquee" behaviour for text overflow #92

Open
catherinetsang opened this issue Aug 3, 2020 · 1 comment

Comments

@catherinetsang
Copy link

Great tutorial! Just a minor suggestion about the VideoDescription text which displays the song details. I noticed TikTok's got a marquee-behaviour to display long song details.

I've tried 2 things: adding dependency: https://pub.dev/packages/marquee and a stack overflow solution: https://stackoverflow.com/questions/51772543/how-to-make-a-text-widget-act-like-marquee-when-the-text-overflows-in-flutter but cannot seem to get the effect working.

Do you have any suggestions on what might be a solution?

@FilledStacks
Copy link
Owner

@catherinetsang I would manually do it. Put the text in a scoll view, then use the controller of that view to animate the scroll position. When it gets to the end I would animated it back, pause, and then repeat.

The end position can be retrieved from the controller which will give you the max offset of the calculated scrollable area (I think). then you can use a tween between 0 and that amount to linearly interpolate the value over time. I have a video that goes over 3 animation techniques here.

Check it out and try 1 of them. The sequence animation would work well for this because then you can make your delay apart of the squence. If the comment is a bit unclear watch the video first, understand how controllers work and then come back and read this and you "should" get it. I hope.

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

No branches or pull requests

2 participants