-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Exposing ScrollBehaviors for app-wide settings #76739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exposing ScrollBehaviors for app-wide settings #76739
Conversation
|
Gold has detected about 1 untriaged digest(s) on patchset 1. |
| /// | ||
| /// {@macro flutter.widgets.scrollBehavior} | ||
| /// | ||
| /// Setting a [CupertinoScrollBehavior] for your app will result in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(also elsewhere in this PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh gosh thanks. I've feel like I've fallen off the wagon lately with passive language and empty prose. 🤣
| this.shortcuts, | ||
| this.actions, | ||
| this.restorationScopeId, | ||
| this.scrollBehavior, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to bake this into the WidgetApp? The widget app could just not have an oppinion and you can provide the behavior you want by wrapping it in a ScrollConfiguration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(if we keep this, MaterialApp and CuppertinoApp should pass this in instead of wrapping with their own ScrollConfiguraiton)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I go back and forth, I settled on yes since every app has to have a ScrollBehavior.. but I could go either way. I'll clean this up to have Material/Cupertino pass it and see how it looks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, now that I play with it the other way, I think it's cleaner to go with the other option.
goderbauer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
This pull request is not suitable for automatic merging in its current state.
|
|
Confirmed the Google testing failure was a flake. Set to green manually. |
This change exposes the current ScrollBehaviors used in
Widgets, Cupertino, and Material Apps. The default behaviors for Cupertino and Material were previously private, so they have been made public to enable users to extend and build on them to create their own custom ScrollBehaviors.This also adds the ability to provide your own default ScrollBehavior at the app level. This was not easily achieved or discovered before by users looking to change default behaviors like the glowing overscroll indicator. Previously, users would need to add their own ScrollConfiguration in the tree to subvert the default one created by the app.
This is an important prerequisite to #71322 and #40107, which will add new default features to ScrollBehavior.
Fixes #76490
Design Document
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.