mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Adds a function to each 'wheel' DataPacket sent to the framework so it can signal whether to `allowPlatformDefault` or not. The current default is to always `preventDefault` on browser events that get sent to the framework. This PR enables the framework to call a method on the `DataPacket`s to `allowPlatformDefault: true`, if the framework won't handle the Signal (signals are handled synchronously on the framework). This lets the engine "wait" for the framework to decide whether to `preventDefault` on a `wheel` event or not. ## Issues * Needed for: https://github.com/flutter/flutter/issues/139263 ## Tests * Added unit tests for the feature in the engine repo, veryfing whether the event has had its `defaultPrevented` or not. * Manually tested in a demo app (see below) ## Demo * https://dit-multiview-scroll.web.app <details> <summary> ## Previous approaches </summary> 1. Add a `handled` bool property to `PointerDataPacket` that the framework can write to (brittle) 2. Modifications to the `PlatformDispatcher` so the framework can `acknowledgePointerData` with a `PointerDataResponse` (fffffatttt change) 3. `acknowledge` function in `PointerDataPacket` </details> > [!IMPORTANT] > * Related: https://github.com/flutter/flutter/pull/145500 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Description
Flutter makes it easy and fast to build beautiful apps for mobile and beyond
androidapp-frameworkcross-platformdartdart-platformdesktopflutterflutter-packagefuchsiaioslinux-desktopmacosmaterial-designmobilemobile-developmentskiawebweb-frameworkwindows
2.5 GiB
Languages
Dart
75%
C++
16.5%
Objective-C++
2.9%
Java
2.8%
Objective-C
0.7%
Other
1.9%