InputText class

如是需要再输入框中显示选中项后的项内容,可使用提供的 InputExtend 组件实现

Inheritance
Available extensions

Constructors

InputText({required TextEditingController? controller, InputController? inputController, InlineStyle inline = InlineStyle.clearStyle, Widget? title, bool noBorder = false, double bgRadius = 10, bool enableForm = false, bool enableClear = true, bool fixClearIcon = false, Widget? clearIcon = const Icon(Icons.cancel, size: 20, color: Colors.grey), ClearBuilder? clearBuilder, 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, BuildPop? buildPop, bool onFocusShowPop = false, FocusListener? focusListener, PopBox? popBox, double marginTop = 0, double? popElevation = 0.0, Color? popColor = Colors.transparent, Color? popShadowColor, Color? popSurfaceTintColor, TextStyle? popChildTextStyle, BorderRadiusGeometry? popBorderRadius, ShapeBorder? popShape, 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, EditableTextContextMenuBuilder? contextMenuBuilder, 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 enableInteractiveSelection = 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 = const OutlineInputBorder(borderSide: BorderSide.none), String? semanticCounterText, bool? alignLabelWithHint, BoxConstraints? constraints, ValueChanged<String>? onFieldSubmitted, FormFieldSetter<String>? onSaved, FormFieldValidator<String>? validator, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, MainAxisSize mainAxisSize = MainAxisSize.min, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, 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
buildPop → BuildPop?
final
clearBuilder → BuildPop?
需要额外自定义删除框样式。
final
clearIcon → Widget?
输入框末尾的删除按钮样式 enableClear为真是生效
final
clipBehavior → Clip
final
constraints → BoxConstraints?
final
contentPadding → EdgeInsetsGeometry?
final
contextMenuBuilder → EditableTextContextMenuBuilder?
final
controller → TextEditingController?
final
counter → Widget?
final
counterStyle → TextStyle?
final
counterText → String?
final
crossAxisAlignment → CrossAxisAlignment
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
enableInteractiveSelection → 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
fixClearIcon → bool
是否固定清空按钮,否则失去焦点则不显示
final
floatingLabelAlignment → FloatingLabelAlignment?
final
floatingLabelBehavior → FloatingLabelBehavior?
final
floatingLabelStyle → TextStyle?
final
focusColor → Color?
final
focusedBorder → InputBorder?
final
focusedErrorBorder → InputBorder?
final
focusListener → FocusListener?
焦点监听
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
inputController → InputController?
输入框弹出层相关控制
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
mainAxisAlignment → MainAxisAlignment
final
mainAxisSize → MainAxisSize
final
margin → EdgeInsetsGeometry?
final
marginTop → double
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
onFocusShowPop → bool
是否是有焦点即显示 pop
final
onSaved → FormFieldSetter<String>?
final
onSubmitted → ValueChanged<String>?
final
onTap → VoidCallback?
final
padding → EdgeInsetsGeometry?
final
popBorderRadius → BorderRadiusGeometry?
final
popBox → PopBox?
final
popChildTextStyle → TextStyle?
final
popColor → Color?
final
popElevation → double?
final
popShadowColor → Color?
final
popShape → ShapeBorder?
final
popSurfaceTintColor → Color?
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
validator → FormFieldValidator<String>?
final
width → double?
输入框的宽度,默认填充父布局
final

Methods

blurred({double blur = 5, Color blurColor = Colors.white, BorderRadius? borderRadius, double colorOpacity = 0.5, Widget? overlay, AlignmentGeometry alignment = Alignment.center}) → Blur

Available on Widget, provided by the BlurExtension extension

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
frosted({double blur = 5, Color frostColor = Colors.white, AlignmentGeometry alignment = Alignment.center, double? height, double? width, double frostOpacity = 0.0, BorderRadius? borderRadius, EdgeInsetsGeometry padding = EdgeInsets.zero}) → Blur

Available on Widget, provided by the FrostExtension extension

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