getRandomElement<T> function

T getRandomElement<T>(
  1. List<T> list
)

Implementation

T getRandomElement<T>(List<T> list) {
  final random = Random();
  var i = random.nextInt(list.length);
  return list[i];
}