randomList method

List<String> randomList({
  1. int count = 1,
})

Implementation

List<String> randomList({int count = 1}) {
  if (count > images.length) {
    return List.generate(
        count, (index) => images[Random().nextInt(images.length)]);
  }
  List<String> shuffled = List.from(images)..shuffle();
  return shuffled.take(count).toList();
}