📜  在 dart 代码示例的列表中选择特定的子列表

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

代码示例1
import "dart:math";

var list = ['a','b','c','d','e'];

// generates a new Random object
final _random = new Random();

// generate a random index based on the list length
// and use it to retrieve the element
var element = list[_random.nextInt(list.length)];