shuffle<T> static method

List<T> shuffle<T>(
  1. List<T> values
)

Shuffles the given list and returns a new shuffled list.

Implementation

static List<T> shuffle<T>(List<T> values) {
  final list = List<T>.from(values);
  final rand = math.Random();
  list.shuffle(rand);
  return list;
}