getUuid function

String getUuid(
  1. int length, {
  2. String? text,
})

getRandom uuid for parameters @extra

Implementation

String getUuid(int length, {String? text}) {
  var ch = '0123456789abcdefghijklmnopqrstuvwxyz';
  if (text != null && text.isNotEmpty) {
    ch = text;
  }
  Random r = Random();
  return String.fromCharCodes(
      Iterable.generate(length, (_) => ch.codeUnitAt(r.nextInt(ch.length))));
}