randomOrNull method
Returns a random element from this collection using the specified source of randomness, or null if this collection is empty.
Implementation
E? randomOrNull([Random? random]) => isEmpty ? null : this.random(random);
Returns a random element from this collection using the specified source of randomness, or null if this collection is empty.
E? randomOrNull([Random? random]) => isEmpty ? null : this.random(random);