generateRandomStringByLength static method
生成指定长度随机字符串
Implementation
static String generateRandomStringByLength({int length = 10}) {
const characters =
'1234567890AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz';
Random random = Random();
return String.fromCharCodes(Iterable.generate(length,
(_) => characters.codeUnitAt(random.nextInt(characters.length))));
}