[PR]: `ListWheelScrollView` and `SingleChildScrollView` support (break change)
Closed this issue · 1 comments
Currently, all kinds of observers only support scroll views that have a RenderSlvier
between items and RenderAbstractViewport
, e.g., SliverList
, SliverGrid
, ListView
ad GridView
. Therefore, it would require tracking up to find the closest RenderSliver
ancestor for observation.
However, such usages do not work on ListWheelScrollView
and SingleChildScrollView
that do not have a RenderSliver
between the viewport and items. So this package should provide a better way to support such kinds of scroll views that do not depend on RenderSliver
.
In order to differentiate the two kinds of scroll views (one relying on RenderSliver
, while the other does not rely on RenderSliver
), this package could create two kinds of observers to support them respectively. For example:
SliverScrollObserver
for observing scroll views that rely onRenderSliver
.BoxScrollObserver
for observing scroll views that have noRenderSliver
between items and its viewport.
Besides, PositionScrollController
may make it a little bit complicated to manage multiple observers, so it would be removed directly. Developers should care about creating and managing observers manually, instead of delegating to PositionedScrollController
centrally.
To summarize:
-
break changes
PositionedScrollController
is removed, and developers should create and manage different observers manually.- Two kinds of observers:
SliverScrollObserver
andBoxScrollObserver
are provided. In contrast,ScrollObserver
would be changed into the observer factory that allows developers to create different observers conveniently. ListWheelScrollView
andSingleChildScrollView
are supported by usingBoxScrollObserver
. Developers could find examples atexample/
.
-
improvements
- better estimation for jumping/animating to a specific index. Particularly, items have a fixed item extent.
Merged in ffcaf89