TextView class

无默认边框的轻量文本输入组件。

Inheritance

Constructors

TextView({Key? key, TextEditingController? controller, String? placeholder, Color textColor = Colors.black, Color? placeholderColor, TextAlign textAlign = TextAlign.left, String? fontFamily, double? fontSize, FontWeight? fontWeight, int? maxLines, int? maxLength, bool isShowCounterText = false, bool autofocus = false, FocusNode? focusNode, TextInputType? keyboardType, bool enable = true, bool isDense = true, TextInputAction? textInputAction, VoidCallback? onTap, ValueChanged<String>? onChanged, ValueChanged<String>? onSubmitted})
创建一个文本输入框。
const

Properties

autofocus bool
是否在组件创建后自动获取焦点。
final
controller TextEditingController?
文本编辑控制器。
final
enable bool
输入框是否可用。
final
focusNode FocusNode?
输入框使用的焦点节点。
final
fontFamily String?
输入文字和占位文字使用的字体族名称。
final
fontSize double?
输入文字和占位文字大小。
final
fontWeight FontWeight?
输入文字和占位文字粗细。
final
hashCode int
The hash code for this object.
no setterinherited
isDense bool
是否使用紧凑的上下边距。
final
isShowCounterText bool
是否显示输入字符计数器。
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardType TextInputType?
软键盘输入类型。
final
maxLength int?
允许输入的最大字符数。
final
maxLines int?
最大显示行数。
final
onChanged ValueChanged<String>?
输入内容发生变化时的回调,参数为最新文本。
final
onSubmitted ValueChanged<String>?
提交输入内容时的回调,参数为已提交文本。
final
onTap VoidCallback?
点击输入框时的回调。
final
placeholder String?
输入内容为空时显示的占位文字。
final
placeholderColor Color?
占位文字颜色。
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
textAlign TextAlign
输入文字的水平对齐方式。
final
textColor Color
输入文字颜色。
final
textInputAction TextInputAction?
软键盘操作按钮的类型。
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's 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
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, 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

Operators

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