include method
Returns a new ShellCommandsMap with the given command
added to
systemShell
.
Implementation
ShellCommandsMap include({
required String command,
required SystemShell systemShell,
}) {
final modifiable = _modifiable();
if (modifiable.containsKey(systemShell)) {
modifiable[systemShell]!.add(command);
} else {
modifiable[systemShell] = {command};
}
return UnmodifiableMapView(
modifiable.map((key, value) => MapEntry(key, UnmodifiableSetView(value))),
);
}