remove method
Remove specific commands from the queue by reference identity.
Implementation
void remove(List<QueuedCommand> commandsToRemove) {
if (commandsToRemove.isEmpty) return;
final before = _commandQueue.length;
for (int i = _commandQueue.length - 1; i >= 0; i--) {
if (commandsToRemove.contains(_commandQueue[i])) {
_commandQueue.removeAt(i);
}
}
if (_commandQueue.length != before) {
_notifySubscribers();
}
for (final _ in commandsToRemove) {
_logOperation(QueueOperation.remove);
}
}