FormerTextField<TForm extends FormerForm> constructor

const FormerTextField<TForm extends FormerForm>({
  1. required FormerField field,
  2. Key? key,
  3. TextEditingController? controller,
  4. FocusNode? focusNode,
  5. InputDecoration? decoration = const InputDecoration(),
  6. TextInputType? keyboardType,
  7. TextInputAction? textInputAction,
  8. TextCapitalization textCapitalization = TextCapitalization.none,
  9. TextStyle? style,
  10. StrutStyle? strutStyle,
  11. TextAlign textAlign = TextAlign.start,
  12. TextAlignVertical? textAlignVertical,
  13. TextDirection? textDirection,
  14. bool readOnly = false,
  15. ToolbarOptions? toolbarOptions,
  16. bool? showCursor,
  17. bool autofocus = false,
  18. String obscuringCharacter = '•',
  19. bool obscureText = false,
  20. bool autocorrect = true,
  21. SmartDashesType? smartDashesType,
  22. SmartQuotesType? smartQuotesType,
  23. bool enableSuggestions = true,
  24. int? maxLines = 1,
  25. int? minLines,
  26. bool expands = false,
  27. int? maxLength,
  28. MaxLengthEnforcement? maxLengthEnforcement,
  29. ValueChanged<String>? onChanged,
  30. VoidCallback? onEditingComplete,
  31. ValueChanged<String>? onSubmitted,
  32. AppPrivateCommandCallback? onAppPrivateCommand,
  33. List<TextInputFormatter>? inputFormatters,
  34. bool? enabled,
  35. double cursorWidth = 2.0,
  36. double? cursorHeight,
  37. Radius? cursorRadius,
  38. Color? cursorColor,
  39. BoxHeightStyle selectionHeightStyle = BoxHeightStyle.tight,
  40. BoxWidthStyle selectionWidthStyle = BoxWidthStyle.tight,
  41. Brightness? keyboardAppearance,
  42. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  43. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  44. bool enableInteractiveSelection = true,
  45. TextSelectionControls? selectionControls,
  46. GestureTapCallback? onTap,
  47. MouseCursor? mouseCursor,
  48. InputCounterWidgetBuilder? buildCounter,
  49. ScrollController? scrollController,
  50. ScrollPhysics? scrollPhysics,
  51. Iterable<String>? autofillHints,
  52. String? restorationId,
})

Creates a text field that consumes the FormerForm in context.

field has to be:

An AssertionError is thrown when field is incompatible.

By default, the enabled state of this field follows that of FormerForm. This can be overridden with the enabled option.

This constructor mirrors all the options for the TextField widget.

Implementation

const FormerTextField({
  required this.field,
  Key? key,
  this.controller,
  this.focusNode,
  this.decoration = const InputDecoration(),
  this.keyboardType,
  this.textInputAction,
  this.textCapitalization = TextCapitalization.none,
  this.style,
  this.strutStyle,
  this.textAlign = TextAlign.start,
  this.textAlignVertical,
  this.textDirection,
  this.readOnly = false,
  this.toolbarOptions,
  this.showCursor,
  this.autofocus = false,
  this.obscuringCharacter = '•',
  this.obscureText = false,
  this.autocorrect = true,
  this.smartDashesType,
  this.smartQuotesType,
  this.enableSuggestions = true,
  this.maxLines = 1,
  this.minLines,
  this.expands = false,
  this.maxLength,
  this.maxLengthEnforcement,
  this.onChanged,
  this.onEditingComplete,
  this.onSubmitted,
  this.onAppPrivateCommand,
  this.inputFormatters,
  this.enabled,
  this.cursorWidth = 2.0,
  this.cursorHeight,
  this.cursorRadius,
  this.cursorColor,
  this.selectionHeightStyle = BoxHeightStyle.tight,
  this.selectionWidthStyle = BoxWidthStyle.tight,
  this.keyboardAppearance,
  this.scrollPadding = const EdgeInsets.all(20.0),
  this.dragStartBehavior = DragStartBehavior.start,
  this.enableInteractiveSelection = true,
  this.selectionControls,
  this.onTap,
  this.mouseCursor,
  this.buildCounter,
  this.scrollController,
  this.scrollPhysics,
  this.autofillHints,
  this.restorationId,
}) : super(key: key);