TextField constructor

const TextField({
  1. Key? key,
  2. ScrollController? scrollController,
  3. bool autocorrect = true,
  4. bool canRequestFocus = true,
  5. double? cursorHeight,
  6. TextCapitalization textCapitalization = TextCapitalization.none,
  7. EdgeInsets scrollPadding = EdgeInsets.zero,
  8. TextEditingController? controller,
  9. int? maxLength,
  10. MaxLengthEnforcement? maxLengthEnforcement,
  11. int? maxLines = 1,
  12. int? minLines,
  13. bool filled = false,
  14. String? placeholder,
  15. bool border = true,
  16. Widget? leading,
  17. Widget? trailing,
  18. EdgeInsetsGeometry? padding,
  19. ValueChanged<String>? onSubmitted,
  20. VoidCallback? onEditingComplete,
  21. FocusNode? focusNode,
  22. VoidCallback? onTap,
  23. bool enabled = true,
  24. bool readOnly = false,
  25. bool obscureText = false,
  26. String obscuringCharacter = '•',
  27. String? initialValue,
  28. BorderRadiusGeometry? borderRadius,
  29. TextInputType? keyboardType,
  30. TextAlign textAlign = TextAlign.start,
  31. bool expands = false,
  32. TextAlignVertical? textAlignVertical = TextAlignVertical.center,
  33. Iterable<String>? autofillHints,
  34. UndoHistoryController? undoController,
  35. ValueChanged<String>? onChanged,
  36. void onTapOutside(
    1. PointerDownEvent event
    )?,
  37. List<TextInputFormatter>? inputFormatters,
  38. TextStyle? style,
  39. EditableTextContextMenuBuilder? contextMenuBuilder = defaultContextMenuBuilder,
  40. bool useNativeContextMenu = false,
  41. bool? isCollapsed,
  42. TextInputAction? textInputAction,
  43. Clip clipBehavior = Clip.hardEdge,
  44. bool autofocus = false,
  45. AlignmentGeometry? placeholderAlignment,
  46. AlignmentGeometry? leadingAlignment,
  47. AlignmentGeometry? trailingAlignment,
  48. WidgetStatesController? statesController,
  49. TextStyle? placeholderStyle,
  50. EdgeInsets contentPadding = const EdgeInsets.symmetric(vertical: 4),
})

Implementation

const TextField({
  super.key,
  this.scrollController,
  this.autocorrect = true,
  this.canRequestFocus = true,
  this.cursorHeight,
  this.textCapitalization = TextCapitalization.none,
  this.scrollPadding = EdgeInsets.zero,
  this.controller,
  this.maxLength,
  this.maxLengthEnforcement,
  this.maxLines = 1,
  this.minLines,
  this.filled = false,
  this.placeholder,
  this.border = true,
  this.leading,
  this.trailing,
  this.padding,
  this.onSubmitted,
  this.onEditingComplete,
  this.focusNode,
  this.onTap,
  this.enabled = true,
  this.readOnly = false,
  this.obscureText = false,
  this.obscuringCharacter = '•',
  this.initialValue,
  this.borderRadius,
  this.keyboardType,
  this.textAlign = TextAlign.start,
  this.expands = false,
  this.textAlignVertical = TextAlignVertical.center,
  this.autofillHints,
  this.undoController,
  this.onChanged,
  this.onTapOutside,
  this.inputFormatters,
  this.style,
  this.contextMenuBuilder = defaultContextMenuBuilder,
  this.useNativeContextMenu = false,
  this.isCollapsed,
  this.textInputAction,
  this.clipBehavior = Clip.hardEdge,
  this.autofocus = false,
  this.placeholderAlignment,
  this.leadingAlignment,
  this.trailingAlignment,
  this.statesController,
  this.placeholderStyle,
  this.contentPadding = const EdgeInsets.symmetric(
    vertical: 4,
  ),
});