ValidationBuilder constructor
ValidationBuilder({
- bool optional = false,
- String? requiredMessage,
- ValidatorOptions? options,
- String? localeName,
- FormValidatorLocale? locale,
Implementation
ValidationBuilder({
this.optional = false,
this.requiredMessage,
ValidatorOptions? options,
String? localeName,
FormValidatorLocale? locale,
}) : _locale = locale ??
(localeName == null ? globalLocale : createLocale(localeName)),
_options = options ?? globalOptions {
ArgumentError.checkNotNull(_locale, 'locale');
// Unless a builder is optional, the first thing we do is to add a
// [required] validator. All subsequent validators should expect
// a non-null argument.
if (!optional) required(requiredMessage);
}