When I was doing the MenuBar implementation, I made some changes to the PlatformMenuBar to allow it to understand shortcuts a little more, and to deprecate the body parameter rename it to child to match most other widgets.
These are those changes, separated out because they are separable, and I'm trying to make the MenuBar PR smaller.
* Use `curly_braces_in_flow_control_structures` for `foundation`
* Use `curly_braces_in_flow_control_structures` for `gestures`
* Use `curly_braces_in_flow_control_structures` for `painting`
* Use `curly_braces_in_flow_control_structures` for `physics`
* fix comments
* remove trailing space
* fix TODO style
This removes Shorcuts.of and Shortctus.maybeOf because they're not especially useful, since the only thing you can really set on a ShortcutManager is the shortcuts, and the Shortcuts widget that you give it to manages those, so if it rebuilds, it overwrites what you set.
Also, adds a Shortcuts.manager constructor and removes the manager argument to the Shortcuts widget.
Removing these will also eliminate an InheritedWidget for each Shortcuts widget, improving memory usage.
A bunch of random cleanup things I found while doing MenuBar development.
Changes an if test to an assert in binding.dart, since the if should always be true.
Adds the default ShortcutRegistrar that should have been in the ShortcutRegistry PR.
Moves a debug message in the FocusManager to print the result after the focus change instead of before.
Reorders the test parameters in theme_data_test.dart to match the order of the theme data fields everywhere else.
* Reland "Fix Backbutton is not displayed when there is a endDrawer (#102093)"
This reverts commit a4a8e73bce152ab39d6ae839ca51e447f87293fa.
* add todos
This adds a ShortcutsRegistry for ShortcutActivator to Intent mappings that can be modified from its descendants.
This is so that descendants can make shortcuts dynamically available to a larger portion of the app than just their descendants. This is a precursor needed by the new MenuBar, for instance, so that the menu bar itself can be placed where it likes, but the shortcuts it defines can be in effect for most, if not all, of the UI surface in the app. For example, the "Ctrl-Q" quit binding would need to work even if the focused widget wasn't a child of the MenuBar.
This just provides the shortcut to intent mapping, the actions activated by the intent are described in the context where they make sense. For example, defining a "Ctrl-C" shortcut mapped to a "CopyIntent" should perform different functions if it happens while a TextField has focus vs when a drawing has focus, so those different areas would need to define different actions mapped to "CopyIntent". A hypothetical "QuitIntent" would probably be active for the entire app, so would be mapped in an Actions widget near the top of the hierarchy.