Add macOS-specific scroll physics#108298
Conversation
|
im having trouble understanding this graph. is y-axis the initial distance or initial speed? |
The y-axis is velocity |
|
Thanks so much for this @moffatman! And apologies for the delay, I should be finished reviewing today |
Piinks
left a comment
There was a problem hiding this comment.
You want to update the getScrollPhysics of CupertinoScrollBehavior as well. 👍
There was a problem hiding this comment.
In the docs for the iOS version, there is a reference to https://developer.apple.com/documentation/uikit/uiscrollviewdelegate/1619385-scrollviewwillenddragging, is that also relevant here? Or is there another, more relevant reference?
There was a problem hiding this comment.
There isn't a direct analogue, in AppKit the scroll momentum state is seen based on the incoming events' [NSEvent momentumPhase]. The part which converts the velocity to the momentum is not exposed at all.
662fddf to
63529d1
Compare
Piinks
left a comment
There was a problem hiding this comment.
This is looking really good. Apologies for the delay while I was gone.
| double g = guess; | ||
| for (int i = 0; i < iterations; i++) { | ||
| g = g - (f(g) - target) / df(g); | ||
| } | ||
| return g; |
There was a problem hiding this comment.
The style guide discourages abbreviations https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#avoid-abbreviations
Can you expand this shorthand so it is easier to understand?
63529d1 to
e4c60d1
Compare
Piinks
left a comment
There was a problem hiding this comment.
This is really great, thank you for your incredible attention to detail. :)
LGTM!
|
which flutter version will this land in? |
|
@appinteractive Has been in beta channel for a while, should be in the next stable version 3.7. No idea when that releases though |
|
IIRC next release will be around next Jan @appinteractive |
|
Thanks for the response, tried it in 3.7 pre but I still have scroll that has way to little friction on macOS, do I need to specify anything for it to work? Using MaterialApp as a base because Cupertino is barely usable with plugins. (Missing Material) |
|
@appinteractive Can you share some code which reproduces the issue? If you are setting custom scroll physics on any widget, the correct physics for macOS should be |
|
@Piinks After the release of Flutter 3.7 with this included, I'm seeing EDIT: It's also worth mentioning that the errors I'm getting do not trace which scrollable the issue is arising from :/ |
|
Hi @GroovinChip, it sounds like there may be a regression. Can you please file an issue with the last flutter version you were using and a minimal reproduction? |
|
@Piinks Sure thing! Didn't realize it could be a regression :) |
Done - #119323 |
Dotted line =
BouncingScrollPhysicsSolid line = new
BouncingDesktopScrollPhysicsX-marks = Recorded data
Fixes #107752
Pre-launch Checklist
///).