Ashish-Raturi / scroll_loop_auto_scroll

This widget automatically scrolls the custom child widget to an infinite loop.
MIT License
19 stars 7 forks source link

The longer child is the faster it scrolls #4

Open 06153 opened 2 years ago

06153 commented 2 years ago

This would scroll three times faster

Text('Very long text that bleeds out of the rendering space, Very long text that bleeds out of the rendering space, Very long text that bleeds out of the rendering space')

than this Text('Very long text that bleeds out of the rendering space)'

Ashish-Raturi commented 2 years ago

It is because of the duration. if you set 60-sec duration for a small text ex: Text('Very long text that bleeds out of the rendering space')

and the same duration(60 sec) for a long text ex : Text('Very long text that bleeds out of the rendering space, Very long text that bleeds out of the rendering space, Very long text that bleeds out of the rendering space')

Then obviously, the longer text will have more speed.

In Simple, you need to increase the duration of long text.

Screenshot 2022-09-30 at 1 30 53 PM
hacker0id commented 1 year ago

increasing the duration doesn't help, here's the code :

// CODE.

ScrollLoopAutoScroll( delay: Duration(seconds: 1), duration: Duration(minutes: 5), gap: 50, child: Column( children: [ Text( 'Engaging All the Engineering Students to their Personalized Material Desk.', style: TextStyle(fontSize: 20.sp), ), Text( '\n\nThis is all you need in the journey of your bachelor\'s degree.', style: TextStyle(fontSize: 20.sp)), Text( '\n\nThe App provides one of the most convenient and feasible material.\nFree access to all the students via Website and App.', style: TextStyle(fontSize: 20.sp)), Text( '\n\nThe Project includes : \n\"Instant Notes\", \"Past Year Papers\",\"Free Ebooks\".', style: TextStyle(fontSize: 20.sp)), Text( '\n\nThe content is handy and localized according to your plan.', style: TextStyle(fontSize: 20.sp)), ], ), scrollDirection: Axis.vertical),

Bobby-Anggunawan commented 1 year ago

Yes, @Ashish-Raturi answer right, but he uses const to set animation duration in this widget he made. So, when we set duration value, it still on the default value (50 second) because it constant. I try to modify this widget source code and turn the duration property into required so I can change animation speed at runtime depend on how many items I have and now its work 😉

bosaengineering commented 1 year ago

@Ashish-Raturi this is still happening for me on 0.0.5.

Is it possible to make it so Duration is required so it doesn't have to be a constant?