InputText class

Inheritance
Available Extensions

Constructors

InputText({InlineStyle inline = InlineStyle.clearStyle, Widget? title, bool noBorder = false, double bgRadius = 10, bool enableForm = false, bool enableClear = true, Widget clearIcon = const Icon(Icons.cancel, size: 20.0, color: Colors.grey), InputBorder? allLineBorder = const OutlineInputBorder(gapPadding: 0, borderRadius: BorderRadius.all(Radius.circular(10)), borderSide: BorderSide(color: Colors.transparent, width: 0)), double? width, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, AlignmentGeometry? alignment = Alignment.centerLeft, required TextEditingController? controller, bool cursorEnd = false, FocusNode? focusNode, InputDecoration? decoration, TextInputType? keyboardType = TextInputType.text, TextInputAction? textInputAction = TextInputAction.done, TextCapitalization textCapitalization = TextCapitalization.none, TextStyle? style = const TextStyle(fontSize: 14, color: Color(0xff222222)), StrutStyle? strutStyle, TextAlign textAlign = TextAlign.start, TextAlignVertical? textAlignVertical, TextDirection? textDirection, bool readOnly = false, ToolbarOptions? toolbarOptions, bool? showCursor, bool autofocus = false, String obscuringCharacter = '•', bool obscureText = false, bool autocorrect = true, bool enableSuggestions = true, int? maxLines = 1, int? minLines, bool expands = false, int? maxLength, MaxLengthEnforcement? maxLengthEnforcement, ValueChanged<String>? onChanged, VoidCallback? onEditingComplete, ValueChanged<String>? onSubmitted, AppPrivateCommandCallback? onAppPrivateCommand, List<TextInputFormatter>? inputFormatters, bool? enabled = true, double cursorWidth = 2.0, double? cursorHeight, Radius? cursorRadius, Color? cursorColor, Brightness? keyboardAppearance, EdgeInsets scrollPadding = const EdgeInsets.all(20.0), TextSelectionControls? selectionControls, GestureTapCallback? onTap, MouseCursor? mouseCursor, InputCounterWidgetBuilder? buildCounter, ScrollController? scrollController, ScrollPhysics? scrollPhysics, Iterable<String>? autofillHints = const <String>[], Clip clipBehavior = Clip.hardEdge, String? restorationId, bool scribbleEnabled = true, bool enableIMEPersonalizedLearning = true, Widget? icon, Color? iconColor, Widget? label, String? labelText, TextStyle? labelStyle, TextStyle? floatingLabelStyle, String? helperText, TextStyle? helperStyle, int? helperMaxLines, String? hintText, TextStyle? hintStyle = const TextStyle(fontSize: 14, color: Color(0xff999999)), TextDirection? hintTextDirection, int? hintMaxLines, String? errorText, TextStyle? errorStyle, int? errorMaxLines, FloatingLabelBehavior? floatingLabelBehavior, FloatingLabelAlignment? floatingLabelAlignment, bool isCollapsed = true, bool? isDense, EdgeInsetsGeometry? contentPadding = const EdgeInsets.fromLTRB(10.0, 15.0, 10.0, 15.0), Widget? prefixIcon, BoxConstraints? prefixIconConstraints, Widget? prefix, String? prefixText, TextStyle? prefixStyle, Color? prefixIconColor, Widget? suffixIcon, Widget? suffix, String? suffixText, TextStyle? suffixStyle, Color? suffixIconColor, BoxConstraints? suffixIconConstraints, Widget? counter, String? counterText, TextStyle? counterStyle, bool? filled = true, Color? fillColor = Colors.transparent, Color? focusColor, Color? hoverColor = Colors.transparent, InputBorder? errorBorder, InputBorder? focusedBorder, InputBorder? focusedErrorBorder, InputBorder? disabledBorder, InputBorder? enabledBorder, InputBorder? border, String? semanticCounterText, bool? alignLabelWithHint, BoxConstraints? constraints, ValueChanged<String>? onFieldSubmitted, FormFieldSetter<String>? onSaved, FormFieldValidator<String>? validator, Key? key})
const

Properties

alignLabelWithHint bool?
final
alignment AlignmentGeometry?
final
allLineBorder InputBorder?
所有边框的样式
final
autocorrect bool
final
autofillHints Iterable<String>?
final
autofocus bool
final
bgRadius double
配合边框样式 实现圆角
final
border InputBorder?
final
buildCounter InputCounterWidgetBuilder?
final
clearIcon Widget
输入框末尾的删除按钮样式 enableClear为真是生效
final
clipBehavior Clip
final
constraints BoxConstraints?
final
contentPadding EdgeInsetsGeometry?
final
controller TextEditingController?
final
counter Widget?
final
counterStyle TextStyle?
final
counterText String?
final
cursorColor Color?
final
cursorEnd bool
始终光标在末尾
final
cursorHeight double?
final
cursorRadius Radius?
final
cursorWidth double
final
decoration InputDecoration?
final
disabledBorder InputBorder?
final
enableClear bool
是否开启删除按钮
final
enabled bool?
final
enabledBorder InputBorder?
final
enableForm bool
是否使用表单输入框
final
enableIMEPersonalizedLearning bool
final
enableSuggestions bool
final
errorBorder InputBorder?
final
errorMaxLines int?
final
errorStyle TextStyle?
final
errorText String?
final
expands bool
final
fillColor Color?
final
filled bool?
final
floatingLabelAlignment FloatingLabelAlignment?
final
floatingLabelBehavior FloatingLabelBehavior?
final
floatingLabelStyle TextStyle?
final
focusColor Color?
final
focusedBorder InputBorder?
final
focusedErrorBorder InputBorder?
final
focusNode FocusNode?
final
hashCode int
The hash code for this object.
no setterinherited
helperMaxLines int?
final
helperStyle TextStyle?
final
helperText String?
final
hintMaxLines int?
final
hintStyle TextStyle?
final
hintText String?
final
hintTextDirection TextDirection?
final
hoverColor Color?
final
icon Widget?
final
iconColor Color?
final
inline InlineStyle
final
inputFormatters List<TextInputFormatter>?
final
isCollapsed bool
final
isDense bool?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardAppearance Brightness?
final
keyboardType TextInputType?
final
label Widget?
final
labelStyle TextStyle?
final
labelText String?
final
margin EdgeInsetsGeometry?
final
maxLength int?
final
maxLengthEnforcement MaxLengthEnforcement?
final
maxLines int?
final
minLines int?
final
mouseCursor MouseCursor?
final
noBorder bool
设置为真 ,边框样式将取下
final
obscureText bool
final
obscuringCharacter String
final
onAppPrivateCommand AppPrivateCommandCallback?
final
onChanged ValueChanged<String>?
final
onEditingComplete VoidCallback?
final
onFieldSubmitted ValueChanged<String>?
TextFormField所支持的属性
final
onSaved FormFieldSetter<String>?
final
onSubmitted ValueChanged<String>?
final
onTap GestureTapCallback?
final
padding EdgeInsetsGeometry?
final
prefix Widget?
final
prefixIcon Widget?
final
prefixIconColor Color?
final
prefixIconConstraints BoxConstraints?
final
prefixStyle TextStyle?
final
prefixText String?
final
readOnly bool
final
restorationId String?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scribbleEnabled bool
final
scrollController ScrollController?
final
scrollPadding EdgeInsets
final
scrollPhysics ScrollPhysics?
final
selectionControls TextSelectionControls?
final
semanticCounterText String?
final
showCursor bool?
final
strutStyle StrutStyle?
final
style TextStyle?
final
suffix Widget?
final
suffixIcon Widget?
final
suffixIconColor Color?
final
suffixIconConstraints BoxConstraints?
final
suffixStyle TextStyle?
final
suffixText String?
final
textAlign TextAlign
final
textAlignVertical TextAlignVertical?
final
textCapitalization TextCapitalization
final
textDirection TextDirection?
final
textInputAction TextInputAction?
final
title Widget?
final
toolbarOptions ToolbarOptions?
final
validator FormFieldValidator<String>?
final
width double?
输入框的宽度,默认填充父布局
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<InputText>
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