list<T> static method
Generates a list of random values from the provided list.
Parameters:
data: The list of values.length: The length of the generated list.min: The minimum index to use for selecting a value. Default is 0.seed: Seed for the random number generator. Default is null.
Example:
List<String> options = ['A', 'B', 'C', 'D'];
List<String> randomList = RandomProvider.list(options, length: 3, min: 1, seed: 42);
// Result: List of 3 random values from the list ['B', 'C', 'D'].
Implementation
static List<T> list<T>(
Iterable<T> data, {
int? length,
int min = 0,
int? seed,
}) {
length ??= data.length;
final List<T> list = [];
for (int i = 0; i < length; ++i) {
list.add(value(data, max: length, min: min, seed: seed) as T);
}
return list;
}