randomString static method
Generate a random string.
Implementation
static String randomString(
int length, {
String chars =
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
}) {
if (length < 0) {
throw RangeError.value(length, 'length', 'must not be negative');
}
if (chars.isEmpty) {
throw ArgumentError.value(chars, 'chars', 'must not be empty');
}
return List.generate(length, (_) => chars[_random.nextInt(chars.length)])
.join();
}