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
scroll: Drive "scroll to end" through uncertainty about endpoint
As long as the bottom sliver is size zero (or more generally, as long
as maxScrollExtent does not change during the animation), this is
nearly NFC: I believe the only changes in behavior would come from
differences in rounding.
By describing the animation in terms of velocity, rather than a
duration and exact target position, this lets us smoothly handle the
case where we may not know exactly what the position coordinate of the
end will be. A previous commit handled the case where the end comes
sooner than estimated, by promptly stopping when that happens. This
commit ensures the scroll continues past the original estimate, in the
case where the end comes later.
That case is a possibility as soon as there's a bottom sliver with a
message in it: scroll up so the message is offscreen and no longer
built; then have the message edited so it becomes taller; then scroll
back down. It's impossible for the viewport to know that the bottom
sliver's content has gotten taller until we actually scroll back down
and cause the message's widget to get built.
And naturally that will become even more salient of an issue when we
enable the message list to jump into the middle of a long history, so
that the bottom sliver may have content that hasn't yet been scrolled
to, has never been built as widgets, and may not even have yet been
fetched from the server.
In order to control the behavior with a Simulation rather than a fixed
endpoint and duration with a Curve, this commit uses a feature I added
recently for this purpose to DrivenScrollActivity upstream:
flutter/flutter#166730
0 commit comments