getRandomKey method

String getRandomKey(
  1. int length
)

Implementation

String getRandomKey(int length) {
  const _chars = 'abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  return String.fromCharCodes(
      Iterable.generate(
          length, (_) => _chars.codeUnitAt(_rnd.nextInt(_chars.length))
      )
  );
}