BasicTextField.max constructor
BasicTextField.max(
- int max, {
- String? long,
- bool trim = false,
- String? blank,
- TextEditingController? controller,
- String? initialValue,
- InputDecoration? decoration = const InputDecoration(),
- TextInputAction? textInputAction,
- TextStyle? style,
- TextDirection? textDirection,
- TextAlign textAlign = TextAlign.start,
- bool readOnly = false,
- bool obscureText = false,
- bool autocorrect = true,
- String obscuringCharacter = '•',
- int? maxLength,
- TextInputType? keyboardType,
- ValueChanged<
String> ? onChanged, - VoidCallback? onEditingComplete,
- ValueChanged<
String> ? onFieldSubmitted, - FormFieldSetter<
String> ? onSaved, - FormFieldValidator<
String> ? validator, - List<
TextInputFormatter> ? inputFormatters, - bool? enabled,
- EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
- bool enableInteractiveSelection = true,
- AutovalidateMode? autovalidateMode,
- Key? key,
Text form field whose number of characters (length) must be at most max
characters.
max
the maximum length of the input data; it must be > 0.
long
the error message if the length of the input data is longer than
max
.
trim
whether to trim or not the input data.
blank
the error message in case of blank field; if omitted, the field
will not be made required.
validator
an optional extra validation step.
Implementation
BasicTextField.max(
int max, {
String? long,
bool trim = false,
String? blank,
TextEditingController? controller,
String? initialValue,
InputDecoration? decoration = const InputDecoration(),
TextInputAction? textInputAction,
TextStyle? style,
TextDirection? textDirection,
TextAlign textAlign = TextAlign.start,
bool readOnly = false,
bool obscureText = false,
bool autocorrect = true,
String obscuringCharacter = '•',
int? maxLength,
TextInputType? keyboardType,
ValueChanged<String>? onChanged,
VoidCallback? onEditingComplete,
ValueChanged<String>? onFieldSubmitted,
FormFieldSetter<String>? onSaved,
FormFieldValidator<String>? validator,
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(max, long: long), validator ?? _ok),
trim: trim,
blank: blank,
controller: controller,
initialValue: initialValue,
decoration: decoration,
keyboardType: keyboardType,
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,
);