TextFormField method

Widget TextFormField({
  1. TextEditingController? controller,
  2. String? initialValue,
  3. FocusNode? focusNode,
  4. InputDecoration? inputDecoration,
  5. TextInputType? keyboardType,
  6. TextCapitalization? textCapitalization,
  7. TextInputAction? textInputAction,
  8. TextStyle? style,
  9. TextAlign? textAlign,
  10. bool? autofocus,
  11. bool? obscureText,
  12. bool? autocorrect,
  13. bool? autovalidate,
  14. MaxLengthEnforcement? maxLengthEnforcement,
  15. int? maxLines,
  16. int? maxLength,
  17. ValueChanged<String>? changed,
  18. VoidCallback? editingComplete,
  19. ValueChanged<String>? fieldSubmitted,
  20. FormFieldSetter<String>? saved,
  21. FormFieldValidator<String>? validator,
  22. List<TextInputFormatter>? inputFormatters,
  23. bool? enabled,
  24. Brightness? keyboardAppearance,
  25. EdgeInsets? scrollPadding,
  26. InputCounterWidgetBuilder? buildCounter,
  27. ScrollPhysics? scrollPhysics,
  28. Iterable<String>? autofillHints,
  29. 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,
      ),
    );