random method

T random({
  1. Random? random,
})

Implementation

T random({Random? random}) {
  if (random != null) {
    return this[random.nextInt(length)];
  } else {
    return this[DateTime.now().microsecond % length];
  }
}