randomKey static method

String randomKey(
  1. int length
)

Implementation

static String randomKey(int length) {
  const c = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
  final r = Random();
  return String.fromCharCodes(List.generate(
    length,
    (index) => c.codeUnitAt(r.nextInt(c.length)),
  ));
}