randint function

num randint(
  1. List nums
)

Implementation

num randint(List nums) {
  try {
    final randomnum = Random();
    final number = nums[randomnum.nextInt(nums.length)];
    return number;
  } catch (e) {
    rethrow;
  }
}