randomItem method

dynamic randomItem()

Find a random item in a list.

Implementation

dynamic randomItem() {
  if (this == null) return null;
  return this![Random().nextInt(this!.length)];
}