Timer based pointer event resampling
This provides two improvements to pointer event resampling:
1. PostFrameCallbacks are used instead of scheduling frames. This
avoids unnecessary rendering work when resampling is used.
2. Resampling continues when frames are not produced. I.e. input
events keep being delivered at a fixed frequency even if frame
production is taking a long time.
This fixes#72924
Co-authored-by: David Reveman <reveman@google.com>
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
The FocusManager constructor was registering global event handlers
on the shared RawKeyboard instance and the global pointer router.
This posed a few problems: (1) there was no way to unregister these
handlers, and (2) instantiating a second FocusManager would overwrite
the existing focus manager's RawKeyboard handler. This was manifesting
in unexpected ways, such as the fact that constructing a second
BuildOwner (for a parallel tree, for instance) was obliterating the
event handler for the main BuildOwner's focus manager, thus messing
with focus.
This change separates those global event registrations into a
dedicated method, registerGlobalHandlers(), and overrides dispose()
to properly unregister those handlers.
This updates the onKey handler of the FocusNode that the Focus widget manages when the widget is updated and the handler has changed. Also added a setter for onKey to the FocusNode.
This PR replaces the ColoredBox that ListTile uses with an Ink widget. That Ink widget is given a ShapeDecoration with the ListTile's color and shape. This fixes issues where the ListTile color would obscure material ripple effects, and cause the specified shape to not be respected.
This call is unnecessary and wasteful for callers that are building
parallel widget trees, since for those use cases, the caller is
generally going to build the tree synchronously immediately.
This can be useful for offscreen widget trees, where the caller
wants to completely tear down the tree (properly clean up) when
they're done with the tree, to ensure they're not leaving behind
any event listeners that could be registered by child elements
(which could lead to memory leaks and unexpected behavior).