TextField constructor

const TextField({
  1. Key? key,
  2. TextEditingController? controller,
  3. FocusNode? focusNode,
  4. UndoHistoryController? undoController,
  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. bool? showCursor,
  16. bool autofocus = false,
  17. String obscuringCharacter = '•',
  18. bool obscureText = false,
  19. bool autocorrect = true,
  20. SmartDashesType? smartDashesType,
  21. SmartQuotesType? smartQuotesType,
  22. bool enableSuggestions = true,
  23. int? maxLines = 1,
  24. int? minLines,
  25. bool expands = false,
  26. int? maxLength,
  27. MaxLengthEnforcement? maxLengthEnforcement,
  28. ValueChanged<String>? onChanged,
  29. VoidCallback? onEditingComplete,
  30. ValueChanged<String>? onSubmitted,
  31. List<TextInputFormatter>? inputFormatters,
  32. bool? enabled,
  33. double cursorWidth = 2,
  34. double? cursorHeight,
  35. Radius? cursorRadius,
  36. Color? cursorColor,
  37. Brightness? keyboardAppearance,
  38. EdgeInsets scrollPadding = const EdgeInsets.all(20),
  39. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  40. bool enableInteractiveSelection = true,
  41. GestureTapCallback? onTap,
  42. bool onTapAlwaysCalled = false,
  43. TapRegionCallback? onTapOutside,
  44. MouseCursor? mouseCursor,
  45. InputCounterWidgetBuilder? buildCounter,
  46. ScrollController? scrollController,
  47. ScrollPhysics? scrollPhysics,
  48. Iterable<String>? autofillHints = const <String>[],
  49. Clip clipBehavior = Clip.hardEdge,
  50. EditableTextContextMenuBuilder? contextMenuBuilder = TextSelectionMenu.editableText,
  51. bool canRequestFocus = true,
  52. bool enableIMEPersonalizedLearning = true,
})

Implementation

const TextField({
  super.key,
  this.controller,
  this.focusNode,
  this.undoController,
  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.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.inputFormatters,
  this.enabled,
  this.cursorWidth = 2,
  this.cursorHeight,
  this.cursorRadius,
  this.cursorColor,
  this.keyboardAppearance,
  this.scrollPadding = const EdgeInsets.all(20),
  this.dragStartBehavior = DragStartBehavior.start,
  this.enableInteractiveSelection = true,
  this.onTap,
  this.onTapAlwaysCalled = false,
  this.onTapOutside,
  this.mouseCursor,
  this.buildCounter,
  this.scrollController,
  this.scrollPhysics,
  this.autofillHints = const <String>[],
  this.clipBehavior = Clip.hardEdge,
  this.contextMenuBuilder = TextSelectionMenu.editableText,
  this.canRequestFocus = true,
  this.enableIMEPersonalizedLearning = true,
});