password static method
Cryptographically secure random password with configurable character sets.
Uses Random.secure; not affected by Rand.useRng or Rand.seed.
Minimum length is 4. At least one of lowercase, uppercase,
digits, or symbols must remain true.
Rand.password(); // 12-char mixed-charset
Rand.password(length: 20);
Rand.password(symbols: false); // no symbols
Rand.password(uppercase: false, digits: false, symbols: false); // lowercase only
Throws ArgumentError when length < 4 or all character sets are
disabled.
Not for production secrets — see SECURITY.md for the package's stability contract.
Implementation
static String password({
int length = 12,
bool lowercase = true,
bool uppercase = true,
bool digits = true,
bool symbols = true,
}) =>
_i.password(
length: length,
lowercase: lowercase,
uppercase: uppercase,
digits: digits,
symbols: symbols,
);