random method

String random({
  1. int length = 10,
})

This will generate a randomly unorganized string length property will be consider as the random string length

Implementation

String random({int length = 10}) {
  Random random = Random();
  return String.fromCharCodes(
      Iterable.generate(length, (_) => codeUnitAt(random.nextInt(length))));
}