isListValuesAllEquals function
Returns true
if list
elements are all equals to value
.
Implementation
bool isListValuesAllEquals(Object? list, [Object? eqValue]) {
if (list == null || list is! List) return false;
if (list.isEmpty) return false;
eqValue ??= list.first;
return listMatchesAll(list, (v) => v == eqValue);
}