KeyboardDisplay.fromActivator constructor
const
KeyboardDisplay.fromActivator({
- Key? key,
- required ShortcutActivator activator,
- double? spacing,
Creates a KeyboardDisplay from a shortcut activator.
Automatically extracts the keyboard keys from the provided ShortcutActivator and displays them as styled key representations. This constructor is convenient when working with Flutter's shortcut system.
Parameters:
activator(ShortcutActivator, required): Shortcut to extract keys fromspacing(double?, optional): Gap between key displays
Example:
KeyboardDisplay.fromActivator(
activator: SingleActivator(LogicalKeyboardKey.keyS, control: true),
spacing: 4.0,
)
Implementation
const KeyboardDisplay.fromActivator({
super.key,
required ShortcutActivator activator,
this.spacing,
}) : _keys = null,
_activator = activator;