isActivatedBy method Null safety

bool isActivatedBy(
  1. ShortcutActivator activator,
  2. RawKeyEvent event

Returns true if the event and keyboard state would cause this ShortcutActivator to be activated.

If the keyboard state isn't supplied, then it defaults to using RawKeyboard.instance.


static bool isActivatedBy(ShortcutActivator activator, RawKeyEvent event) {
  return (activator.triggers?.contains(event.logicalKey) ?? true)
      && activator.accepts(event, RawKeyboard.instance);