nonAppleBlockedIntents top-level property
A set of Intents, which Flutter dispatches by default on non-Apple platforms (Android, Windows, Linux), that should have its associated Actions blocked.
For example: The user presses the SPACE key on web. By default
Flutter emits an ActivateIntent and a ScrollIntent. But you
probably want to insert a " " in some text instead of activating
or scrolling. Those default Flutter intents must be blocked for
two reasons. First, you don't want to scroll down every time you
type a space. Second, the SPACE key event won't have a chance to
be handled by the OS IME if Flutter handles the key with an Action.
Therefore, you should preveng this set of Intents from bubbling up,
to block those default Flutter behaviors, let the IME handle the key event,
and enjoy expected text input.
To prevent the default Flutter Actions, locate the specific widget where you want to run non-default behaviors, such as inserting a space instead of scrolling. Wrap that widget with an IntentBlocker widget, and then pass this set of Intent types to block the default behaviors:
IntentBlocker(
intents: nonAppleBlockedIntents,
child: SuperEditor(),
)
See WidgetsApp.defaultShortcuts for the list of keybindings that Flutter adds by default.
Implementation
final Set<Type> nonAppleBlockedIntents = {
ActivateIntent,
ScrollIntent,
};