toInfoString method

  1. @override
String toInfoString({
  1. bool withParentEvents = true,
  2. bool withType = true,
  3. String indent = '',
})
override

Implementation

@override
String toInfoString(
    {bool withParentEvents = true,
    bool withType = true,
    String indent = ''}) {
  var s = StringBuffer();

  if (withType) {
    s.write('[$type]');
  }

  var extra = [
    if (shiftKey) 'SHIFT',
    if (ctrlKey) 'CTRL',
    if (altKey) 'ALT',
    if (metaKey) 'META',
  ];

  s.write(
      '{type: $type, key: <$key>, charCode: $charCode, code: <$code>}${extra.isNotEmpty ? '$extra' : ''}');

  _appendTargetInfo(s);
  _appendParentInfo(s, withParentEvents, indent);

  return s.toString();
}