password static method

String password([
  1. int length = 32
])

Implementation

static String password([int length = 32]) {
  const characters =
      r'!@#\$%^&*()-_=+0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  var random = Random.secure();

  return String.fromCharCodes(
    Iterable.generate(
      length,
      (_) => characters.codeUnitAt(random.nextInt(characters.length)),
    ),
  );
}