randomNextIntFromList static method

int randomNextIntFromList(
  1. List<int> list
)

随机数,从给定的范围中获取。

参数

  • list 给定数

Implementation

static int randomNextIntFromList(List<int> list) {
  var ran = Random();
  return list.elementAt(ran.nextInt(list.length));
}