randomItem property
T?
get
randomItem
Implementation
T? get randomItem {
if (this.isEmpty) {
return null;
}
int n = Random().nextInt(this.length);
return this[n];
}
T? get randomItem {
if (this.isEmpty) {
return null;
}
int n = Random().nextInt(this.length);
return this[n];
}