randomString function
String
randomString(
- int length, {
- int from = asciiStart,
- int to = asciiEnd,
- AbstractRandomProvider provider = const DefaultRandomProvider(),
Generates a random string of length
with characters
between ascii from
to to
.
Defaults to characters of ascii '!' to '~'.
Implementation
String randomString(int length,
{int from = asciiStart,
int to = asciiEnd,
AbstractRandomProvider provider = const DefaultRandomProvider()}) {
return String.fromCharCodes(List.generate(
length, (index) => randomBetween(from, to, provider: provider)));
}