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

scrollToIndex throwing an exception for very small scroll durations #83

Open
D-Raiser opened this issue Jan 11, 2022 · 0 comments
Open

Comments

@D-Raiser
Copy link

When passing a duration to scrollToIndex that is smaller than 40µs (basically using it as a jumpTo with index), the call throws the following exception:

I/flutter ( 3806): 'package:flutter/src/widgets/scroll_activity.dart': Failed assertion: line 623 pos 15: 'duration > Duration.zero': is not true.
I/flutter ( 3806): #0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:46:39)
I/flutter ( 3806): #1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5)
I/flutter ( 3806): #2      new DrivenScrollActivity (package:flutter/src/widgets/scroll_activity.dart:623:15)
I/flutter ( 3806): #3      ScrollPositionWithSingleContext.animateTo (package:flutter/src/widgets/scroll_position_with_single_context.dart:181:43)
I/flutter ( 3806): #4      ScrollController.animateTo (package:flutter/src/widgets/scroll_controller.dart:154:68)
I/flutter ( 3806): #5      AutoScrollControllerMixin._scrollToIndex (package:scroll_to_index/scroll_to_index.dart:285:15)

It seems that this happens because the duration passed as a parameter is divided by 40 and the result is then used as the actual duration but there is no documentation why (or whether) this division is necessary

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

1 participant