removeRandom method

T removeRandom([
  1. int? seed
])

Removes and returns a random value from this list.

Implementation

T removeRandom([int? seed]) {
  assert(isNotEmpty, 'The list must not be empty.');
  final element = random(seed);
  remove(element);
  return element;
}