TextField constructor
const
TextField({
- Key? key,
- 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 = AlignmentDirectional.centerStart,
Implementation
const TextField({
super.key,
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 = AlignmentDirectional.centerStart,
});