flutter 3.44 pre

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-05-14 21:48:25 +08:00
parent 3c6d4ef08c
commit cf2877b77c
34 changed files with 1173 additions and 329 deletions

View File

@@ -948,9 +948,6 @@ class ScrollableState<T extends HorizontalDragGestureRecognizer>
void _receivedPointerSignal(PointerSignalEvent event) {
if (event is PointerScrollEvent && _position != null) {
if (_physics != null && !_physics!.shouldAcceptUserOffset(position)) {
// The handler won't use the `event`, so allow the platform to trigger
// any default native actions.
event.respond(allowPlatformDefault: true);
return;
}
final double delta = _pointerSignalEventDelta(event);
@@ -965,9 +962,6 @@ class ScrollableState<T extends HorizontalDragGestureRecognizer>
);
return;
}
// The `event` won't result in a scroll, so allow the platform to trigger
// any default native actions.
event.respond(allowPlatformDefault: true);
} else if (event is PointerScrollInertiaCancelEvent) {
position.pointerScroll(0);
// Don't use the pointer signal resolver, all hit-tested scrollables should stop.
@@ -976,12 +970,16 @@ class ScrollableState<T extends HorizontalDragGestureRecognizer>
void _handlePointerScroll(PointerEvent event) {
assert(event is PointerScrollEvent);
final double delta = _pointerSignalEventDelta(event as PointerScrollEvent);
final scrollEvent = event as PointerScrollEvent;
final double delta = _pointerSignalEventDelta(scrollEvent);
final double targetScrollOffset = _targetScrollOffsetForPointerScroll(
delta,
);
if (delta != 0.0 && targetScrollOffset != position.pixels) {
position.pointerScroll(delta);
// Tell engine this scrollable handled the event.
// This prevents parent page from scrolling when nested scrollables exist.
scrollEvent.respond(allowPlatformDefault: false);
}
}