ShortcutSerialization.character constructor Null safety

ShortcutSerialization.character(
  1. String character,
  2. {bool alt = false,
  3. bool control = false,
  4. bool meta = false}
)

Creates a ShortcutSerialization representing a single character.

This is used by a CharacterActivator to serialize itself.

Implementation

ShortcutSerialization.character(String character, {
  bool alt = false,
  bool control = false,
  bool meta = false,
})  : assert(character.length == 1),
      _character = character,
      _trigger = null,
      _alt = alt,
      _control = control,
      _meta = meta,
      _shift = null,
      _internal = <String, Object?>{
        _kShortcutCharacter: character,
        _kShortcutModifiers: (control ? _shortcutModifierControl : 0) |
            (alt ? _shortcutModifierAlt : 0) |
            (meta ? _shortcutModifierMeta : 0),
      };