TextField constructor

const TextField({
  1. Key? key,
  2. Object? groupId,
  3. String? label,
  4. Widget? labelWidget,
  5. bool appendColonToLabel = true,
  6. TextStyle? labelStyle,
  7. String? hintText,
  8. FocusNode? focusNode,
  9. UndoHistoryController? undoController,
  10. String? errorText,
  11. bool enabled = true,
  12. bool readOnly = false,
  13. Widget? suffix,
  14. Widget? suffixIcon,
  15. Widget? prefix,
  16. Widget? prefixIcon,
  17. bool obscureText = false,
  18. String obscuringCharacter = '•',
  19. bool? filled,
  20. Color? fillColor,
  21. BorderRadius? borderRadius,
  22. TextEditingController? controller,
  23. List<InputFeedbackText>? feedback,
  24. TextInputType? keyboardType,
  25. List<TextInputFormatter>? inputFormatters,
  26. TextCapitalization textCapitalization = material.TextCapitalization.none,
  27. TextAlign textAlign = material.TextAlign.start,
  28. TextInputAction? textInputAction,
  29. StrutStyle? strutStyle,
  30. TextDirection? textDirection,
  31. int? maxLength,
  32. MaxLengthEnforcement? maxLengthEnforcement,
  33. int? maxLines = 1,
  34. int? minLines,
  35. bool? expands,
  36. TextStyle? textStyle,
  37. ValueChanged<String>? onChanged,
  38. VoidCallback? onEditingComplete,
  39. ValueChanged<String>? onSubmitted,
  40. AppPrivateCommandCallback? onAppPrivateCommand,
  41. InputDecoration? decoration,
  42. bool overrideDecoration = false,
  43. TextAlignVertical? textAlignVertical,
  44. WrapWidgetBuilder? innerBoxWrapper,
  45. EdgeInsets scrollPadding = const EdgeInsets.all(10),
  46. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  47. bool? autocorrect,
  48. SmartDashesType? smartDashesType,
  49. SmartQuotesType? smartQuotesType,
  50. double? cursorHeight,
  51. bool forceErrorStyle = false,
  52. bool? showCursor,
  53. Iterable<String>? autofillHints = const [],
  54. GestureTapCallback? onTap,
  55. bool onTapAlwaysCalled = false,
  56. TapRegionCallback? onTapOutside,
  57. TapRegionUpCallback? onTapUpOutside,
  58. bool autofocus = false,
  59. bool canRequestFocus = true,
  60. bool enableSuggestions = true,
  61. bool enableInteractiveSelection = true,
  62. TextSelectionControls? selectionControls,
  63. BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
  64. BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
  65. Brightness? keyboardAppearance,
  66. InputCounterWidgetBuilder? buildCounter,
  67. EditableTextContextMenuBuilder? contextMenuBuilder,
  68. Clip clipBehavior = material.Clip.hardEdge,
  69. Color? cursorColor,
  70. Color? cursorErrorColor,
  71. double cursorWidth = 2.0,
  72. Radius? cursorRadius,
  73. bool cursorOpacityAnimates = true,
  74. MouseCursor? mouseCursor,
  75. ScrollController? scrollController,
  76. ScrollPhysics? scrollPhysics,
  77. ContentInsertionConfiguration? contentInsertionConfiguration,
  78. String? restorationId,
  79. bool scribbleEnabled = true,
  80. bool? stylusHandwritingEnabled,
  81. bool enableIMEPersonalizedLearning = true,
  82. SpellCheckConfiguration? spellCheckConfiguration,
  83. TextMagnifierConfiguration? magnifierConfiguration,
  84. WidgetStatesController? statesController,
  85. bool? ignorePointers,
})

Implementation

const TextField({
  Key? key,
  this.groupId,
  this.label,
  this.labelWidget,
  this.appendColonToLabel = true,
  this.labelStyle,
  this.hintText,
  this.focusNode,
  this.undoController,
  this.errorText,
  this.enabled = true,
  this.readOnly = false,
  this.suffix,
  this.suffixIcon,
  this.prefix,
  this.prefixIcon,
  this.obscureText = false,
  this.obscuringCharacter = '•',
  this.filled,
  this.fillColor,
  this.borderRadius,
  this.controller,
  this.feedback,
  this.keyboardType,
  this.inputFormatters,
  this.textCapitalization = material.TextCapitalization.none,
  this.textAlign = material.TextAlign.start,
  this.textInputAction,
  this.strutStyle,
  this.textDirection,
  this.maxLength,
  this.maxLengthEnforcement,
  this.maxLines = 1,
  this.minLines,
  this.expands,
  this.textStyle,
  this.onChanged,
  this.onEditingComplete,
  this.onSubmitted,
  this.onAppPrivateCommand,
  this.decoration,
  this.overrideDecoration = false,
  this.textAlignVertical,
  this.innerBoxWrapper,
  this.scrollPadding = const EdgeInsets.all(10),
  this.dragStartBehavior = DragStartBehavior.start,
  this.autocorrect,
  this.smartDashesType,
  this.smartQuotesType,
  this.cursorHeight,
  this.forceErrorStyle = false,
  this.showCursor,
  this.autofillHints = const [],
  this.onTap,
  this.onTapAlwaysCalled = false,
  this.onTapOutside,
  this.onTapUpOutside,
  this.autofocus = false,
  this.canRequestFocus = true,
  this.enableSuggestions = true,
  this.enableInteractiveSelection = true,
  this.selectionControls,
  this.selectionHeightStyle = ui.BoxHeightStyle.tight,
  this.selectionWidthStyle = ui.BoxWidthStyle.tight,
  this.keyboardAppearance,
  this.buildCounter,
  this.contextMenuBuilder,
  this.clipBehavior = material.Clip.hardEdge,
  this.cursorColor,
  this.cursorErrorColor,
  this.cursorWidth = 2.0,
  this.cursorRadius,
  this.cursorOpacityAnimates = true,
  this.mouseCursor,
  this.scrollController,
  this.scrollPhysics,
  this.contentInsertionConfiguration,
  this.restorationId,
  this.scribbleEnabled = true,
  this.stylusHandwritingEnabled,
  this.enableIMEPersonalizedLearning = true,
  this.spellCheckConfiguration,
  this.magnifierConfiguration,
  this.statesController,
  this.ignorePointers,
})  : assert(
        label == null || labelWidget == null,
        'You cannot provide both `label` and `labelWidget` at the same time. '
        'Use only one of them.',
      ),
      super(key: key);