isAllEqualsInList function

bool isAllEqualsInList(
  1. List? list,
  2. Object value, [
  3. bool deep = false
])

Returns true if list elements are all equals to value.

deep IF true checks deeply collections values.

Implementation

bool isAllEqualsInList(List? list, Object value, [bool deep = false]) {
  if (list == null || list.isEmpty) return false;

  for (var e in list) {
    if (!isEquals(e, value, deep)) {
      return false;
    }
  }

  return true;
}