TextField constructor
const
TextField({
- Key? key,
- ScrollController? scrollController,
- bool autocorrect = true,
- bool canRequestFocus = true,
- double? cursorHeight,
- TextCapitalization textCapitalization = TextCapitalization.none,
- EdgeInsets scrollPadding = EdgeInsets.zero,
- TextEditingController? controller,
- int? maxLength,
- MaxLengthEnforcement? maxLengthEnforcement,
- int? maxLines = 1,
- int? minLines,
- bool filled = false,
- String? placeholder,
- bool border = true,
- Widget? leading,
- Widget? trailing,
- EdgeInsetsGeometry? padding,
- ValueChanged<
String> ? onSubmitted, - VoidCallback? onEditingComplete,
- FocusNode? focusNode,
- VoidCallback? onTap,
- bool enabled = true,
- bool readOnly = false,
- bool obscureText = false,
- String obscuringCharacter = '•',
- String? initialValue,
- BorderRadiusGeometry? borderRadius,
- TextInputType? keyboardType,
- TextAlign textAlign = TextAlign.start,
- bool expands = false,
- TextAlignVertical? textAlignVertical = TextAlignVertical.center,
- Iterable<
String> ? autofillHints, - UndoHistoryController? undoController,
- ValueChanged<
String> ? onChanged, - void onTapOutside(
- PointerDownEvent event
- List<
TextInputFormatter> ? inputFormatters, - TextStyle? style,
- EditableTextContextMenuBuilder? contextMenuBuilder = defaultContextMenuBuilder,
- bool useNativeContextMenu = false,
- bool? isCollapsed,
- TextInputAction? textInputAction,
- Clip clipBehavior = Clip.hardEdge,
- bool autofocus = false,
- AlignmentGeometry? placeholderAlignment,
- AlignmentGeometry? leadingAlignment,
- AlignmentGeometry? trailingAlignment,
- WidgetStatesController? statesController,
- TextStyle? placeholderStyle,
- 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,
),
});