EmailField.len constructor Null safety
- int len,
- {bool trim = false,
- String? blank,
- String? malformed,
- String? long,
- String? initialValue,
- FormFieldValidator<
String> ? validator, - TextEditingController? controller,
- InputDecoration? decoration = const InputDecoration(),
- TextInputAction? textInputAction,
- TextStyle? style,
- TextDirection? textDirection,
- TextAlign textAlign = TextAlign.start,
- bool readOnly = false,
- String obscuringCharacter = '•',
- bool obscureText = false,
- bool autocorrect = true,
- int? maxLength,
- ValueChanged<
String> ? onChanged, - VoidCallback? onEditingComplete,
- ValueChanged<
String> ? onFieldSubmitted, - FormFieldSetter<
String> ? onSaved, - List<
TextInputFormatter> ? inputFormatters, - bool? enabled,
- EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
- bool enableInteractiveSelection = true,
- AutovalidateMode? autovalidateMode,
- Key? key}
Email field that limits the length of the email to up to len
characters.
len
the maximum length of an email address; it must be > 0.
trim
whether or not to trim the entered email.
validator
an optional extra validation step.
blank
the error message in case of blank field; if omitted, the field
will not be made required.
malformed
the error message in case of a malformed email.
long
the error message if the length of the entered email > len
.
Implementation
EmailField.len(
int len, {
bool trim = false,
String? blank,
String? malformed,
String? long,
String? initialValue,
FormFieldValidator<String>? validator,
TextEditingController? controller,
InputDecoration? decoration = const InputDecoration(),
TextInputAction? textInputAction,
TextStyle? style,
TextDirection? textDirection,
TextAlign textAlign = TextAlign.start,
bool readOnly = false,
String obscuringCharacter = '•',
bool obscureText = false,
bool autocorrect = true,
int? maxLength,
ValueChanged<String>? onChanged,
VoidCallback? onEditingComplete,
ValueChanged<String>? onFieldSubmitted,
FormFieldSetter<String>? onSaved,
List<TextInputFormatter>? inputFormatters,
bool? enabled,
EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
bool enableInteractiveSelection = true,
AutovalidateMode? autovalidateMode,
Key? key,
}) : this(
validator: Pair.str2(Len.max(len, long: long), validator ?? _dummy),
malformed: malformed,
blank: blank,
trim: trim,
controller: controller,
initialValue: initialValue,
decoration: decoration,
textInputAction: textInputAction,
style: style,
textDirection: textDirection,
textAlign: textAlign,
readOnly: readOnly,
obscuringCharacter: obscuringCharacter,
obscureText: obscureText,
autocorrect: autocorrect,
maxLength: maxLength,
onChanged: onChanged,
onEditingComplete: onEditingComplete,
onFieldSubmitted: onFieldSubmitted,
onSaved: onSaved,
inputFormatters: inputFormatters,
enabled: enabled,
scrollPadding: scrollPadding,
enableInteractiveSelection: enableInteractiveSelection,
autovalidateMode: autovalidateMode,
key: key,
);