-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
@darrenaustin found this - thanks!
In looking at why the fix for #101416 was reverted, the change that fixed it (#101460) exposed a separate bug. SingleChildScrollView does not respond to ScrollMetricsNotifications beyond the first initial notification.
This is because ScrollMetricsNotifications are considered for dispatch during ScrollPosition.applyContentDimensions. This is called during the course of performLayout of the RenderViewport, which lays out children lazily, causing ScrollPosition.applyContentDimensions to be called regularly in the course of scrolling. This function returns true or false to indicate if we need to perform layout again.
SingleChildScrollView has its own viewport render object, and only performs layout once (since it only has one child), so it never calls applyContentDimensions after the initial layout.
We should be able to call applyContentDimensions in the already existing _RenderSingleChildViewport._hasScrolled, it will return true and not cause additional layouts.
We should also check and see if other custom viewports have the same bug and add a comment indicating that if it changes in one, it should be updated in the rest.