AntdInputBase<WidgetType> class abstract

Inheritance
Mixed-in types
Implementers

Constructors

AntdInputBase.new({Key? key, AntdInputStyle? style, AntdStyleBuilder<AntdInputStyle, WidgetType>? styleBuilder, FocusNode? focusNode, bool clearable = true, String? value, bool disabled = false, ValueChanged<String?>? onChange, VoidCallback? onEditingComplete, ValueChanged<String>? onSubmitted, VoidCallback? onClear, Widget? placeholder, bool readOnly = false, AntdInputController? controller, TextAlign textAlign = TextAlign.start, bool obscureIcon = true, bool obscureText = false, bool autocorrect = false, int? maxLines, int? minLines, int? maxLength, TextInputType? keyboardType = TextInputType.text, TextInputAction? inputAction, SelectionChangedCallback? onSelectionChanged, List<TextInputFormatter>? formatters, Widget? prefix, Widget? suffix, VoidCallback? onTap, EditableTextContextMenuBuilder? contextMenuBuilder, UndoHistoryController? undoController, SpellCheckConfiguration? spellCheckConfiguration, TextMagnifierConfiguration? magnifierConfiguration, AppPrivateCommandCallback? onAppPrivateCommand, DragStartBehavior dragStartBehavior = DragStartBehavior.start, ScrollController? scrollController, ScrollPhysics? scrollPhysics = const ClampingScrollPhysics(), Clip clipBehavior = Clip.hardEdge, AntdOnFocus? onFocus})
const

Properties

autocorrect bool
是否自动校正拼写错误(如iOS键盘的自动修正),默认为true
final
child Widget
no setterinherited
clearable bool
是否显示清除按钮(点击会清空输入内容)
final
clipBehavior Clip
内容裁剪方式(如抗锯齿裁剪)
final
contextMenuBuilder EditableTextContextMenuBuilder?
自定义上下文菜单构建器(长按文本时弹出的菜单)
final
controller AntdInputController?
输入框的控制器,用于程序化控制文本内容
final
disabled bool
是否禁用输入框
final
dragStartBehavior DragStartBehavior
拖动行为的起始方式(如立即响应或延迟响应)
final
focusNode FocusNode?
控制输入框的焦点状态
final
formatters List<TextInputFormatter>?
输入内容格式过滤器(如限制数字、正则匹配等)
final
hashCode int
The hash code for this object.
no setterinherited
inputAction TextInputAction?
键盘动作按钮类型(如搜索、发送等)
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardType TextInputType?
键盘类型(如数字键盘、邮箱键盘等)
final
magnifierConfiguration TextMagnifierConfiguration?
文本放大镜配置(长按选中文本时的放大效果)
final
maxLength int?
允许输入的最大字符数
final
maxLines int?
输入框的最大行数(多行文本时生效)
final
minLines int?
输入框的最小行数(多行文本时生效)
final
obscureIcon bool
是否显示密码可见性切换图标(仅当obscureText=true时有效)
final
obscureText bool
是否以密码形式隐藏输入内容(显示为圆点),默认为false
final
onAppPrivateCommand AppPrivateCommandCallback?
处理来自键盘的私有命令(如第三方键盘扩展功能)
final
onChange ValueChanged<String?>?
输入内容变化时的回调函数
final
onClear VoidCallback?
点击清除按钮时的回调函数
final
onEditingComplete VoidCallback?
编辑完成时的回调(通常点击键盘完成/下一步时触发)
final
onFocus AntdOnFocus?
焦点事件
final
onSelectionChanged SelectionChangedCallback?
文本选中范围变化时的回调
final
onSubmitted ValueChanged<String>?
文本提交时的回调(通常点击键盘发送/搜索时触发)
final
onTap VoidCallback?
输入框点击事件回调
final
placeholder Widget?
输入框为空时显示的提示文本
final
prefix Widget?
输入框前缀部件(如图标、标签等)
final
readOnly bool
是否为只读模式(可选中文本但不可编辑)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollController ScrollController?
滚动控制器(用于控制多行文本的滚动位置)
final
scrollPhysics ScrollPhysics?
滚动物理效果(如滚动边界行为)
final
spellCheckConfiguration SpellCheckConfiguration?
拼写检查配置(如启用/禁用、错误文本样式等)
final
style AntdInputStyle?
样式
finalinherited
styleBuilder AntdStyleBuilder<AntdInputStyle, WidgetType>?
动态样式
finalinherited
suffix Widget?
输入框后缀部件(如图标、按钮等)
final
textAlign TextAlign
文本对齐方式(左/中/右)
final
undoController UndoHistoryController?
撤销/重做历史控制器
final
value String?
输入框的初始值
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
Creates the mutable state for this widget at a given location in the tree.
inherited
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
getDefaultStyle(BuildContext context, AntdTheme theme, AntdMapToken token) AntdInputStyle
override
getFinalStyle(BuildContext context, AntdInputStyle style, AntdMapToken token) AntdInputStyle
inherited
getInputStyle(BuildContext context) AntdInputStyle?
inherited
getStyle(BuildContext context) AntdInputStyle
inherited
getStyleBuilder(BuildContext context) AntdStyleBuilder<AntdInputStyle, WidgetType>?
inherited
getThemeStyle(BuildContext context, AntdTheme theme) AntdStyleBuilder<AntdInputStyle, WidgetType>?
inherited
getValue(BuildContext context) → dynamic
inherited
getWidget(BuildContext context) → WidgetType
inherited
isFromItemEnv(BuildContext context) bool
inherited
margeStyle(AntdInputStyle defaultStyle, AntdInputStyle? style) AntdInputStyle
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setValue(BuildContext context, dynamic value, AntdFormTrigger sourceTrigger) → void
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, int wrapWidth = 65}) 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
useValue(BuildContext context, void action(dynamic value)) → void
inherited

Operators

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