isOneAKind property
bool
get
isOneAKind
Checks if all list data have same value.
Returns
true
if all list data have same valuefalse
otherwise
Implementation
bool get isOneAKind {
if(isEmpty) {
return false;
} else {
var first = this[0];
int len = length;
for (int i = 0; i < len; i++) {
if (this[i] != first) {
return false;
}
}
return true;
}
}