randomAlphanumeric function

String randomAlphanumeric(
  1. int length, {
  2. bool isUppercase = false,
})

Implementation

String randomAlphanumeric(int length, {bool isUppercase = false}) {
  const String chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
  final String pool = isUppercase ? chars.toUpperCase() : chars;
  return List<String>.generate(length, (_) => pool[_rnd.nextInt(pool.length)]).join();
}