equals method
Returns true
if this
and other
have equivalent KeyCodes.
Note: KeyCodes are considered equivalent to one another
if any one of their keyId
s are the same.
Implementation
bool equals(Keybinding? other) {
if (other == null || keyCodes.length != other.keyCodes.length) {
return false;
}
final otherKeyCodes = List<KeyCode>.from(other.keyCodes);
for (var keyCode in keyCodes) {
if (!otherKeyCodes
.removeFirstWhere((otherKeyCode) => keyCode.equals(otherKeyCode))) {
return false;
}
}
return true;
}