randomList<E> static method

E randomList<E>(
  1. List<E> list
)

Returns a pseudo-random element <E> from the parameter list. Using the Random() class to compute the List index.

Implementation

@pragma("vm:prefer-inline")
static E randomList<E>(List<E> list) {
  return list[randomRangeInt(0, list.length)];
}