generateRandomString method

String generateRandomString(
  1. int length
)

Implementation

String generateRandomString(int length) {
  String chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  return String.fromCharCodes(
    List.generate(
        length, (_) => chars.codeUnitAt(_random.nextInt(chars.length))),
  );
}