printableText property

String? get printableText

Printable text represented by this event, or null for a command key. Space and slash retain their public event types for command bindings.

Implementation

String? get printableText {
  switch (type) {
    case KeyEventType.space:
      return ' ';
    case KeyEventType.slash:
      return '/';
    case KeyEventType.char:
      return char != null && KeyEventReader._isPrintableCharacter(char!)
          ? char
          : null;
    default:
      return null;
  }
}