randomList method

List<num> randomList({
  1. int min = 0,
  2. int max = 100,
})

Get list of random numbers.

Implementation

List<num> randomList({int min = 0, int max = 100}) {
  var result = <num>[];
  for (var i = 0; i < this; i++) {
    result.add(Random().nextInt(max - min) + min);
  }
  return result;
}