Open sm2017 opened 4 years ago
I had the same problem and I think is got to do with below initialData state when generating the group headers.
StreamBuilder
If you use GroupedListView within a stateful widget and your state changes (for example when changing filter elements) this _topElementIndex seemes to be pre-populated with the previous value hence showing the previous top header. It all fixes itself once you start scrolling. What I ended up doing was to create and pass the ScrollController to the GroupedListView widget and right after I changed my parent widget state I call scrollController.notifyListeners(); to manually trigger scrolling notification to re-calculate the top header group.
return GroupedListView<Point,String>(
controller: _scrollController,
);
and then
setState(() { filter = newfilter; // Here is where your widget state changes _scrollController.notifyListeners(); });
I have a search field that filter
elements
, When I changeelements
by filtering them , sticky header (that removed by filtering) is not removed and after scrolling is removed