addAll method Null safety

ShortcutRegistryEntry addAll(
  1. Map<ShortcutActivator, Intent> value
)

Adds all the given shortcut bindings to this ShortcutRegistry, and returns a entry for managing those bindings.

The entry should have ShortcutRegistryEntry.dispose called on it when these shortcuts are no longer needed. This will remove them from the registry, and invalidate the entry.

This method will assert in debug mode if another entry exists (i.e. hasn't been disposed of) that has already added a given shortcut.

If two equivalent, but different, ShortcutActivators are added, all of them will be executed when triggered. For example, if both SingleActivator(LogicalKeyboardKey.keyA) and CharacterActivator('a') are added, then both will be executed when an "a" key is pressed.

See also:

Implementation

ShortcutRegistryEntry addAll(Map<ShortcutActivator, Intent> value) {
  assert(ChangeNotifier.debugAssertNotDisposed(this));
  final ShortcutRegistryEntry entry = ShortcutRegistryEntry._(this);
  _tokenShortcuts[entry] = value;
  assert(_debugCheckForDuplicates());
  notifyListeners();
  return entry;
}