BasicTextField class

Inheritance
Available extensions

Constructors

BasicTextField({Key? key, String? value, TextEditingController? controller, ValueCallback<String>? searchTextTap, DecoratorPositioned searchTextPositioned = DecoratorPositioned.outer, DecoratorPositioned sendSMSPositioned = DecoratorPositioned.outer, SendSMSValueCallback? sendSMSTap, bool enableEye = false, bool enableClearIcon = false, bool enableSearchIcon = false, String? hintText, double width = double.infinity, EdgeInsetsGeometry? margin, EdgeInsetsGeometry? padding, TextStyle? hintStyle, FocusNode? focusNode, Widget? header, String? heroTag, Widget? footer, String? labelText, TextStyle? labelStyle, bool disposeController = true, bool hasFocusChangeBorder = true, Color? fillColor, List<DecoratorEntry> suffix = const [], List<DecoratorEntry> prefix = const [], BorderRadius? borderRadius = const BorderRadius.all(Radius.circular(4)), BorderType borderType = BorderType.outline, BorderSide borderSide = const BorderSide(color: UCS.lineColor, width: 1), BorderSide? focusBorderSide, EdgeInsetsGeometry contentPadding = const EdgeInsets.symmetric(horizontal: 10, vertical: 6), OverlayVisibilityMode clearButtonMode = OverlayVisibilityMode.never, TextInputAction textInputAction = TextInputAction.done, TextCapitalization textCapitalization = TextCapitalization.none, TextStyle? style, StrutStyle? strutStyle, TextAlign textAlign = TextAlign.left, TextAlignVertical? textAlignVertical, TextDirection? textDirection, bool readOnly = false, bool? showCursor, bool autoFocus = false, String obscuringCharacter = '•', bool autocorrect = true, SmartDashesType? smartDashesType, SmartQuotesType? smartQuotesType, bool enableSuggestions = true, int maxLines = 1, int minLines = 1, bool expands = false, int? maxLength, MaxLengthEnforcement? maxLengthEnforcement, ValueChanged<String>? onChanged, ValueCallback<TextEditingController>? onEditingComplete, ValueChanged<String>? onSubmitted, List<TextInputFormatter>? inputFormatters, bool? enabled = true, double cursorWidth = 2.0, double? cursorHeight, Radius cursorRadius = const Radius.circular(2.0), BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight, BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight, Brightness? keyboardAppearance, EdgeInsets scrollPadding = const EdgeInsets.all(20.0), DragStartBehavior dragStartBehavior = DragStartBehavior.start, bool? enableInteractiveSelection, TextSelectionControls? selectionControls, GestureTapCallback? onTap, ScrollController? scrollController, ScrollPhysics? scrollPhysics, Iterable<String>? autofillHints = const [], Clip clipBehavior = Clip.hardEdge, String? restorationId, bool scribbleEnabled = true, bool enableIMEPersonalizedLearning = true, TextInputLimitFormatter textInputType = TextInputLimitFormatter.text, EditableTextContextMenuBuilder? contextMenuBuilder, TextMagnifierConfiguration? magnifierConfiguration, TapRegionCallback? onTapOutside, SpellCheckConfiguration? spellCheckConfiguration})
const

Properties

autocorrect bool
Whether to enable autocorrection.
final
autofillHints Iterable<String>?
A list of strings that helps the autofill service identify the type of this text input.
final
autoFocus bool
是否自动获取焦点 默认false
final
borderRadius BorderRadius?
边框样式
final
borderSide BorderSide
final
borderType BorderType
final
clearButtonMode OverlayVisibilityMode
final
clipBehavior Clip
The content will be clipped (or not) according to this option.
final
contentPadding EdgeInsetsGeometry
***** TextField *****
final
contextMenuBuilder EditableTextContextMenuBuilder?
final
controller TextEditingController?
final
cursorHeight double?
final
cursorRadius Radius
final
cursorWidth double
final
disposeController bool
dispose 时调用 controller 的 dispose
final
dragStartBehavior DragStartBehavior
Determines the way that drag start behavior is handled.
final
enableClearIcon bool
开启 清除 icon
final
enabled bool?
是否可输入
final
enableEye bool
开启 显示和隐藏 eye
final
enableIMEPersonalizedLearning bool
Whether to enable that the IME update personalized data such as typing history and user dictionary data.
final
enableInteractiveSelection bool?
Whether to enable user interface affordances for changing the text selection.
final
enableSearchIcon bool
开启 搜索 icon
final
enableSuggestions bool
Whether to show input suggestions as the user types.
final
expands bool
Whether this widget's height will be sized to fill its parent.
final
fillColor Color?
输入框填充色
final
focusBorderSide BorderSide?
final
focusNode FocusNode?
焦点管理
final
final
hasFocusChangeBorder bool
final
hashCode int
The hash code for this object.
no setterinherited
头部和底部 添加组件
final
heroTag String?
添加hero
final
hintStyle TextStyle?
提示文字样式
final
hintText String?
提示文字
final
inputFormatters List<TextInputFormatter>?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardAppearance Brightness?
The appearance of the keyboard.
final
labelStyle TextStyle?
final
labelText String?
final
magnifierConfiguration TextMagnifierConfiguration?
final
margin EdgeInsetsGeometry?
整个组件的margin 包含headerfooter
final
maxLength int?
最长输入的字符串
final
maxLengthEnforcement MaxLengthEnforcement?
final
maxLines int
默认为 1
final
minLines int
final
obscuringCharacter String
隐藏输入内容时显示的字符串
final
onChanged ValueChanged<String>?
输入框变化监听
final
onEditingComplete ValueCallback<TextEditingController>?
按回车时调用 先调用此方法 然后调用onSubmitted方法
final
onSubmitted ValueChanged<String>?
final
onTap GestureTapCallback?
输入框点击数事件
final
onTapOutside TapRegionCallback?
final
padding EdgeInsetsGeometry?
整个组件的padding 包含headerfooter
final
prefix List<DecoratorEntry>
前缀
final
readOnly bool
Whether the text can be changed.
final
restorationId String?
Restoration ID to save and restore the state of the text field.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scribbleEnabled bool
Whether iOS 14 Scribble features are enabled for this widget.
final
scrollController ScrollController?
The ScrollController to use when vertically scrolling the input.
final
scrollPadding EdgeInsets
Configures padding to edges surrounding a Scrollable when the Textfield scrolls into view.
final
scrollPhysics ScrollPhysics?
The ScrollPhysics to use when vertically scrolling the input.
final
searchTextPositioned DecoratorPositioned
final
searchTextTap ValueCallback<String>?
添加 搜索文字 点击事件
final
selectionControls TextSelectionControls?
Optional delegate for building the text selection handles.
final
selectionHeightStyle BoxHeightStyle
Controls how tall the selection highlight boxes are computed to be.
final
selectionWidthStyle BoxWidthStyle
Controls how wide the selection highlight boxes are computed to be.
final
sendSMSPositioned DecoratorPositioned
final
sendSMSTap SendSMSValueCallback?
添加 发送验证码 点击事件
final
showCursor bool?
Whether to show cursor.
final
smartDashesType SmartDashesType?
Whether to allow the platform to automatically format dashes.
final
smartQuotesType SmartQuotesType?
Whether to allow the platform to automatically format quotes.
final
spellCheckConfiguration SpellCheckConfiguration?
final
strutStyle StrutStyle?
The strut style used for the vertical layout.
final
style TextStyle?
输入文字样式
final
suffix List<DecoratorEntry>
后缀
final
textAlign TextAlign
输入框文字对齐方式
final
textAlignVertical TextAlignVertical?
How the text should be aligned vertically.
final
textCapitalization TextCapitalization
TextCapitalization.characters, /// 输入时键盘的英文都是大写 TextCapitalization.none, /// 键盘英文默认显示小写 TextCapitalization.sentences, /// 在输入每个句子的第一个字母时,键盘大写形式,输入后续字母时键盘小写形式 TextCapitalization.words,/// 在输入每个单词的第一个字母时,键盘大写形式,输入其他字母时键盘小写形式
final
textDirection TextDirection?
final
textInputAction TextInputAction
设置键盘上enter键的显示内容 textInputAction: TextInputAction.search, /// 搜索 textInputAction: TextInputAction.none,/// 默认回车符号 textInputAction: TextInputAction.done,/// 安卓显示 回车符号 textInputAction: TextInputAction.go,/// 开始 textInputAction: TextInputAction.next,/// 下一步 textInputAction: TextInputAction.send,/// 发送 textInputAction: TextInputAction.continueAction,/// android 不支持 textInputAction: TextInputAction.emergencyCall,/// android 不支持 textInputAction: TextInputAction.newline,/// 安卓显示 回车符号 textInputAction: TextInputAction.route,/// android 不支持 textInputAction: TextInputAction.join,/// android 不支持 textInputAction: TextInputAction.previous,/// 安卓显示 回车符号 textInputAction: TextInputAction.unspecified,/// 安卓显示 回车符号
final
textInputType TextInputLimitFormatter
final
value String?
***** 附加功能 ***** 初始化默认的文本
final
width double
宽度
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<BasicTextField>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited