generateRandomString function
Generate cryptographically secure random string
Implementation
String generateRandomString(int length) {
const chars =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~';
final random = Random.secure();
return List.generate(length, (index) => chars[random.nextInt(chars.length)])
.join();
}