You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using a grouped list inside a Scrollbar and passing it a scroll controller, depending on the scroll position, it might display with some item in the middle rather than the very first item. In this situation the top sticky header isn't correct, it shows the first item's group even if we're somewhere in the middle of the list. Only the first slight movement of the list fixes it.
Expected behavior
Correct sticky header upon initial display.
Information:
Dart version: 2.19.6
Flutter version: 3.7.12
Platform: Android
Package version: 5.1.2
The text was updated successfully, but these errors were encountered:
The direct cause seems to be that the StreamBuilder inside _GroupedListViewState.build() only gets fired when _scrollListener explicitely calls it (list actually scrolled and the actual item changes). I can fake the initial display if I initialize _topElementIndex to something else than zero. My immediate thought would be to actually initialize it somehow if the widget.controller is provided to the control when it's started.
A quick solution. I don't PR it yet, first, it's too easy, second, I don't know whether you would think it dangerous for anything else. It looks like simply removing the condition would work:
Describe the bug
When using a grouped list inside a
Scrollbar
and passing it a scroll controller, depending on the scroll position, it might display with some item in the middle rather than the very first item. In this situation the top sticky header isn't correct, it shows the first item's group even if we're somewhere in the middle of the list. Only the first slight movement of the list fixes it.Expected behavior
Correct sticky header upon initial display.
Information:
The text was updated successfully, but these errors were encountered: