string method
Generate random string from specific characters and length.
Implementation
String string(String chars, int length) {
if (chars.isEmpty) {
return "";
}
Random _rnd = Random();
return String.fromCharCodes(Iterable.generate(
length, (_) => chars.codeUnitAt(_rnd.nextInt(chars.length))));
}