random method
Returns a random element from the list. Throws StateError if the list is empty.
Implementation
T random({int? seed}) {
if (isEmpty) throw StateError('Cannot pick from an empty list');
return this[math.Random(seed).nextInt(length)];
}