string static method

String string([
  1. int length = 10
])

Generates a random string of the specified length.

Implementation

static String string([int length = 10]) {
  return String.fromCharCodes(
    Iterable.generate(length, (_) => _chars.codeUnitAt(_random.nextInt(_chars.length))),
  );
}