-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Document on ScrollPhysics the requirement to override applyTo #121850
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
Document on ScrollPhysics the requirement to override applyTo #121850
Conversation
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.
TIL! LGTM, thank you!
This feels like a foot gun though.
I wonder if we could instead make this more like ScrollBehavior, which has a unique copyWith that creates a _WrappedScrollBehavior to preserve custom subclasses.
|
Thanks!
Agreed. I haven't thought about what that could look like (or how to avoid or mitigate breakage from an API change), but something like that would be welcome. |
I missed this when first experimenting with a custom ScrollPhysics subclass a few weeks ago, which led me into about a half-hour of very confused debugging into the framework as I tried to figure out why my code wasn't running. This requirement is already stated on `applyTo` itself, but one won't necessarily see that unless there's already a reason to pay attention to `applyTo`. So it seems best to mention it on the documentation of the class itself.
7b00393 to
97d53d7
Compare
…r#121850) Document on ScrollPhysics the requirement to override applyTo
I missed this when first experimenting with a custom ScrollPhysics subclass a few weeks ago, which led me into about a half-hour of very confused debugging into the framework as I tried to figure out why my code wasn't running.
This requirement is already stated on
applyToitself, but one won't necessarily see that unless there's already a reason to pay attention toapplyTo. So it seems best to mention it on the documentation of the class itself.Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.