Open MiniSuperDev opened 2 years ago
I also encountered this problem. Have you found any solutions? @MiniSuperDev
AutoScrollControllerMixin:
while (prevOffset != currentOffset && !(contains = isIndexStateInLayoutRange(index))) { prevOffset = currentOffset; final nearest = _getNearestIndex(index); final moveTarget = _forecastMoveUnit(index, nearest, usedSuggestedRowHeightIfAny)!; if (moveTarget < 0) //can't forecast the move range return null; // assume suggestRowHeight will move to correct offset in just one time. // if the rule doesn't work (in variable row height case), we will use backup solution (non-suggested way) final suggestedDuration = usedSuggestedRowHeightIfAny && suggestedRowHeight != null ? duration : null;
remove if (moveTarget < 0) //can't forecast the move range return null; is useful
AutoScrollControllerMixin:
while (prevOffset != currentOffset && !(contains = isIndexStateInLayoutRange(index))) { prevOffset = currentOffset; final nearest = _getNearestIndex(index); final moveTarget = _forecastMoveUnit(index, nearest, usedSuggestedRowHeightIfAny)!; if (moveTarget < 0) //can't forecast the move range return null; // assume suggestRowHeight will move to correct offset in just one time. // if the rule doesn't work (in variable row height case), we will use backup solution (non-suggested way) final suggestedDuration = usedSuggestedRowHeightIfAny && suggestedRowHeight != null ? duration : null;
remove if (moveTarget < 0) //can't forecast the move range return null; is useful
there is even no such code
Hi, I try to create a bidirectional lazy load list like the like flutter docs said https://github.com/flutter/flutter/blob/5464c5bac742001448fe4fc0597be939379f88ea/packages/flutter/lib/src/widgets/scroll_view.dart#L502-L513
I create a gist where you can enable a disable the center key, and you can see that only highlight work, but the
scrollTo
not work when the center key is enable.how can I keep the scroll to index behavior while have the center key? or maybe do you know other way to create a list that append items to the top of the list by preserving the scroll, the solution that I used is from https://github.com/flutter/flutter/issues/21541#issuecomment-629121578
thank you