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

scrollTo (with animation) in some case not scroll to the correct item #274

Open
nawaf11 opened this issue Jul 2, 2021 · 4 comments
Open
Labels
p: scrollable_positioned_list Related to package:scrollable_positioned_list

Comments

@nawaf11
Copy link

nawaf11 commented Jul 2, 2021

Problem description

In some cases scrollTo (with animation) not scroll to the correct item (not even close)

Package:
package:scrollable_positioned_list/scrollable_positioned_list.dart

Steps to reproduce

I think 1 of the scenario When user see for example item number 30 and scrollTo get called with item 20 ...

I am calling it in this way:

_itemScrollController?.scrollTo(index: ayahIndex, duration: Duration(milliseconds: 300), alignment: 0.3);

_itemScrollController is instance of ItemScrollController

Environment

Android

Additional details

There's some crash in scrollable_positioned_list In LogCat happen it could be the reason ..

======== Exception caught by scheduler library =====================================================
The following UnsupportedError was thrown during a scheduler callback:
Unsupported operation: Infinity or NaN toInt

When the exception was thrown, this was the stack: 
#0      double.toInt (dart:core-patch/double.dart:219:36)
#1      double.round (dart:core-patch/double.dart:182:34)
#2      _PositionedListState._schedulePositionNotificationUpdate.<anonymous closure> (package:scrollable_positioned_list/src/positioned_list.dart:315:45)
#3      SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144:15)
#4      SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1090:9)
...
====================================================================================================
@jamesderlin jamesderlin added the p: scrollable_positioned_list Related to package:scrollable_positioned_list label Jan 31, 2022
@Maatteogekko
Copy link

could be related to #247

@ggirotto
Copy link

Facing the same issue

@futatalka
Copy link

I'm working with a StickyGroupedListView and I have the same problem, I tried jumpTo and it works as expected but scrollTo has an offset.

@MattyBoy4444
Copy link

Same issue. scrollTo doesn't work, jumpTo works. It seems all the itemPosition.itemLeadingEdge are zero in _startScroll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: scrollable_positioned_list Related to package:scrollable_positioned_list
Projects
None yet
Development

No branches or pull requests

6 participants