RandomStringGenerator constructor
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
Note: The properties are not final. You can modify them after you initialize the object.
var generator = RandomStringGenerator(
mustHaveAtLeastOneOfEach: true,
hasAlpha: true,
alphaCase: AlphaCase.UPPERCASE_ONLY,
hasDigits: true,
hasSymbols: true,
length: 10,
);
generator.generate();
generator.hasDigits = false;
generator.generate();
Implementation
RandomStringGenerator({
this.fixedLength,
this.minLength,
this.maxLength,
this.hasAlpha = true,
this.alphaCase = AlphaCase.MIXED_CASE,
this.hasDigits = true,
this.hasSymbols = true,
this.mustHaveAtLeastOneOfEach = true,
this.customUpperAlphabet,
this.customLowerAlphabet,
this.customDigits,
this.customSymbols,
});