getSecureRandomString static method

String getSecureRandomString(
  1. int length
)

Implementation

static String getSecureRandomString(int length) {
  final random = Random.secure();
  final values = List<int>.generate(length, (i) => random.nextInt(256));
  return base64UrlEncode(values);
}