TextFormField method
Widget
TextFormField({
- TextEditingController? controller,
- String? initialValue,
- FocusNode? focusNode,
- InputDecoration? inputDecoration,
- TextInputType? keyboardType,
- TextCapitalization? textCapitalization,
- TextInputAction? textInputAction,
- TextStyle? style,
- TextAlign? textAlign,
- bool? autofocus,
- bool? obscureText,
- bool? autocorrect,
- bool? autovalidate,
- MaxLengthEnforcement? maxLengthEnforcement,
- int? maxLines,
- int? maxLength,
- ValueChanged<
String> ? changed, - VoidCallback? editingComplete,
- ValueChanged<
String> ? fieldSubmitted, - FormFieldSetter<
String> ? saved, - FormFieldValidator<
String> ? validator, - List<
TextInputFormatter> ? inputFormatters, - bool? enabled,
- Brightness? keyboardAppearance,
- EdgeInsets? scrollPadding,
- InputCounterWidgetBuilder? buildCounter,
- ScrollPhysics? scrollPhysics,
- Iterable<
String> ? autofillHints, - AutovalidateMode? autovalidateMode,
Implementation
// ignore: non_constant_identifier_names
m.Widget TextFormField({
TextEditingController? controller,
String? initialValue,
FocusNode? focusNode,
InputDecoration? inputDecoration,
TextInputType? keyboardType,
TextCapitalization? textCapitalization,
TextInputAction? textInputAction,
TextStyle? style,
TextAlign? textAlign,
bool? autofocus,
bool? obscureText,
bool? autocorrect,
bool? autovalidate,
// bool? maxLengthEnforced,
MaxLengthEnforcement? maxLengthEnforcement,
int? maxLines,
int? maxLength,
ValueChanged<String>? changed,
VoidCallback? editingComplete,
ValueChanged<String>? fieldSubmitted,
FormFieldSetter<String>? saved,
FormFieldValidator<String>? validator,
List<TextInputFormatter>? inputFormatters,
bool? enabled,
Brightness? keyboardAppearance,
EdgeInsets? scrollPadding,
InputCounterWidgetBuilder? buildCounter,
ScrollPhysics? scrollPhysics,
Iterable<String>? autofillHints,
AutovalidateMode? autovalidateMode,
}) =>
m.Material(
child: m.TextFormField(
key: Key('TextFormField$_key'),
// just accept the parameter values and not this object's values.
controller: controller ??
(initialValue == null
? null
: FieldController(text: initialValue)),
// ignore the initValue parameter: initialValue: null,
focusNode: focusNode ?? focusNode,
decoration: inputDecoration ?? this.inputDecoration,
keyboardType: keyboardType ?? this.keyboardType,
textCapitalization: textCapitalization ?? this.textCapitalization!,
textInputAction: textInputAction ?? this.textInputAction,
style: style ?? this.style,
textAlign: textAlign ?? this.textAlign!,
autofocus: autofocus ?? this.autofocus!,
obscureText: obscureText ?? this.obscureText!,
autocorrect: autocorrect ?? this.autocorrect!,
// autovalidate: autovalidate ?? this.autovalidate,
// maxLengthEnforced: maxLengthEnforced ?? this.maxLengthEnforced!,
maxLengthEnforcement:
maxLengthEnforcement ?? this.maxLengthEnforcement!,
maxLines: maxLines ?? this.maxLines,
maxLength: maxLength ?? this.maxLength,
onChanged: changed ?? this.changed ?? onChanged,
onEditingComplete:
editingComplete ?? this.editingComplete ?? onEditingComplete,
onFieldSubmitted:
fieldSubmitted ?? this.fieldSubmitted ?? onFieldSubmitted,
onSaved: saved ?? this.saved ?? onSaved,
validator: validator ?? this.validator ?? onValidator,
inputFormatters: inputFormatters ?? this.inputFormatters,
enabled: enabled ?? this.enabled,
keyboardAppearance: keyboardAppearance ?? this.keyboardAppearance,
scrollPadding: scrollPadding ?? this.scrollPadding!,
buildCounter: buildCounter ?? this.buildCounter,
scrollPhysics: scrollPhysics ?? this.scrollPhysics,
autofillHints: autofillHints ?? this.autofillHints,
autovalidateMode: autovalidateMode ?? this.autovalidateMode,
),
);