isAllEquals function
Returns true
element
is equals to value
.
If element
is a List checks if all entries in the list are equals to
value
.
If element
is a Map checks if all Map.values are equals to
value
.
deep
IF true
checks deeply collections values.
Implementation
bool isAllEquals(Object? element, Object? value, [bool deep = false]) {
if (isEquals(element, value, deep)) {
return true;
}
if (element is List) {
return isAllEqualsInList(element, value!, deep);
} else if (element is Map) {
return isAllEqualsInMap(element, value!, deep);
}
return false;
}