randomString function
- int length,
- {int from: ASCII_START,
- int to: ASCII_END,
- 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 = ASCII_START,
int to = ASCII_END,
AbstractRandomProvider provider = const DefaultRandomProvider()}) {
return String.fromCharCodes(List.generate(
length, (index) => randomBetween(from, to, provider: provider)));
}