string static method

String string(
  1. int length, {
  2. int from = asciiStart,
  3. int to = asciiEnd,
  4. AbstractRandomProvider provider = const DefaultRandomProvider(),
})

Generates a random string of length with characters between ascii from to to. Defaults to characters of ascii '!' to '~'.

Implementation

static String string(
  int length, {
  int from = asciiStart,
  int to = asciiEnd,
  AbstractRandomProvider provider = const DefaultRandomProvider(),
}) {
  return String.fromCharCodes(
    List.generate(
      length,
      (index) => between(from, to, provider: provider),
    ),
  );
}