getRandom method

E? getRandom({
  1. int? seed,
})

Returns a random element of this, or null if this is empty.

If seed is provided, will be used as the random seed for determining which element to select. (See math.Random.)

Implementation

E? getRandom({int? seed}) => this.isEmpty
    ? null
    : this.elementAt(math.Random(seed).nextInt(this.length));