generateUuid function

String generateUuid(
  1. int length, {
  2. String text = "0123456789abcdefghijklmnopqrstuvwxyz",
})

Implementation

String generateUuid(
  int length, {
  String text = "0123456789abcdefghijklmnopqrstuvwxyz",
}) {
  // final Random random = Random();
  return List.generate(length, (index) {
    final String data_text = text[Random().nextInt(text.length)];
    if (Random().nextBool()) {
      return data_text.toUpperCase();
    } else {
      return data_text;
    }
  }).join("");
}