RandomStringGenerator class

Random string generator.

Can be used to generate passwords as well.

Constructors

RandomStringGenerator({int? fixedLength, int? minLength, int? maxLength, bool hasAlpha = true, AlphaCase alphaCase = AlphaCase.MIXED_CASE, bool hasDigits = true, bool hasSymbols = true, bool mustHaveAtLeastOneOfEach = true, List<String>? customUpperAlphabet, List<String>? customLowerAlphabet, List<String>? customDigits, List<String>? customSymbols})
Constructor

Properties

alphaCase AlphaCase
Specify the case (upper, lower or mixed) for the hasAlpha property. Has effect only if the property is TRUE.
getter/setter pair
customDigits List<String>?
You might want to provide your custom digits.
getter/setter pair
customLowerAlphabet List<String>?
You might want to provide your custom lowercase alphabet.
getter/setter pair
customSymbols List<String>?
You might want to provide your custom symbols.
getter/setter pair
customUpperAlphabet List<String>?
You might want to provide your custom uppercase alphabet.
getter/setter pair
fixedLength int?
Generated string fixed length.
getter/setter pair
hasAlpha bool
Boolean flag to specify if the generated string should have alpha characters in it.
getter/setter pair
hasDigits bool
Boolean flag to specify if the generated string should have digits in it.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hasSymbols bool
Boolean flag to specify if the generated string should have symbols in it.
getter/setter pair
maxLength int?
Generated string maximum length. (use min and max OR fixed, not both)
getter/setter pair
minLength int?
Generated string minimum length. (use min and max OR fixed, not both)
getter/setter pair
mustHaveAtLeastOneOfEach bool
This boolean flag is maybe the most interesting thing about this string generator. Here's how it works:
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

generate() String
Generate the string using current properties
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited