Dimibe / grouped_list

A Flutter ListView in which items can be grouped into sections.
https://pub.dev/packages/grouped_list
MIT License
391 stars 107 forks source link

"primary" parameter doesn't work #201

Open Julian-Webb opened 5 months ago

Julian-Webb commented 5 months ago

Describe the bug When you use the primary flag, which should tell the GroupedListView to use the PrimaryScrollController, you get the following error:

image

This happens even when you don't specify your own ScrollController. I think this happens because on line 245 in your source code you assign _controller = widget.controller ?? ScrollController(); but instead of creating a new ScrollController, you would need to access the PrimaryScrollController.of(context)

Expected behavior The GroupedListView should use the PrimaryScrollController when primary: true.

Information: