shuffledList<T> function

List<T> shuffledList<T>(
  1. Iterable<T> it,
  2. bool cryptographicallySecure
)

Return a shuffled List.

Implementation

List<T> shuffledList<T>(Iterable<T> it, bool cryptographicallySecure) {
  List<T> copy = List.from(it);
  Random r = cryptographicallySecure ? Random.secure() : Random();
  copy.shuffle(r);
  return copy;
}