Description
On Android, the platform provides two different scrolling behaviors: one for native scrollables, and one for browsers and webviews. The difference is that the browser scrolling includes a "flywheel" or "momentum" behavior. (Details in chat.) This is very useful when scrolling through a ton of content — hence the usage in browsers — because it means that with several quick flicks of their finger the user can get the page scrolling very quickly, and scrolling very far before it comes to a stop.
Flutter's default scrolling behavior on Android (after flutter/flutter#120420 and flutter/flutter#122338) closely matches that of native Android scrollables, without a flywheel. There currently isn't an option for the flywheel scrolling found in Android webviews.
For the Zulip message list, flywheel scrolling is probably useful for much the same reason it is in a browser: sometimes the content is very long and you want to scan through it quickly. So it'd be good to try it out.
Props to @terpimost for detecting that there was something about the "overall max speed of scroll" that didn't feel right and would be good to compare to "browser based scroll" in particular — I think the difference he was sensing is probably exactly this. (I learned about this pair of contrasting behaviors from studying the Android scrolling code back in February, around the time of flutter/flutter#120420 and the related issues I filed.)
Implementation
Probably the right home for that behavior is as an option in Flutter upstream. It's a behavior that Android users are accustomed to — in fact most Android users probably do most of their scrolling in contexts that have this behavior, because large quantities of content calling for lots of scrolling tend to be web pages (and even when they're not overtly so, are often presented in a webview.) So when a Flutter app has a scrollable that's more in the nature of "a lot of content presented for reading, akin to a long web page" than "a list of items in a UI", probably the behavior that will best match Android users' expectations will be flywheel scrolling. Which means it should be an option that Flutter developers can readily choose in their apps.
Specifically, this probably means either a new subclass of ScrollPhysics
, or a new feature on the existing subclass ClampingScrollPhysics
which provides the Android behavior. Either way, the appropriate ScrollPhysics
can then be passed in places like the physics
parameter of ListView.builder
(which becomes ScrollView.physics
).
Metadata
Metadata
Assignees
Labels
Type
Projects
Status