shortcuts property

Map<LogicalKeySet, Intent> shortcuts
final

The default map of keyboard shortcuts to intents for the application.

By default, this is set to WidgetsApp.defaultShortcuts.

This example shows how to add a single shortcut for LogicalKeyboardKey.select to the default shortcuts without needing to add your own Shortcuts widget.

Alternatively, you could insert a Shortcuts widget with just the mapping you want to add between the WidgetsApp and its child and get the same effect.

Widget build(BuildContext context) {
  return WidgetsApp(
    shortcuts: <LogicalKeySet, Intent>{
      ... WidgetsApp.defaultShortcuts,
      LogicalKeySet(LogicalKeyboardKey.select): const ActivateIntent(),
    },
    color: const Color(0xFFFF0000),
    builder: (BuildContext context, Widget child) {
      return const Placeholder();
    },
  );
}
See also:

Implementation

final Map<LogicalKeySet, Intent> shortcuts