📜  获取唯一的随机数 dart 代码示例

📅  最后修改于: 2022-03-11 14:48:04.958000             🧑  作者: Mango

代码示例2
List numberList=[];
Random random = new Random();
while(numberList.length<5){
   int random_number = randomizer.nextInt(50);
   if (!numberList.contains(random_number)){
     numberList.add(random_number);
   }
 }