DebounceTextField class

可以设置在停止接收到TextFieldonChanged方法多久后再触发DebounceTextFieldonChanged方法 适用场景: TextField一边输入内容, 一边根据内容进行网络请求(或其他耗资源的操作), 这时需要 根据输入的节奏来调整网络请求的次数, duration参数可以设置在用户停止输入多久之后, 开始网络 请求(或其他耗资源操作).

Inheritance

Constructors

DebounceTextField({Key key, ValueChanged<String> onChanged, Duration duration: const Duration(milliseconds: 500), TextEditingController controller, FocusNode focusNode, InputDecoration decoration: const InputDecoration(), TextInputType keyboardType: TextInputType.text, TextStyle style, TextAlign textAlign: TextAlign.start, bool autofocus: false, bool obscureText: false, bool autocorrect: true, int maxLines: 1, int maxLength, bool maxLengthEnforced: true, ValueChanged<String> onSubmitted, List<TextInputFormatter> inputFormatters, bool enabled, TextInputAction textInputAction})

Properties

autocorrect → bool
final
autofocus → bool
final
controller TextEditingController
final
decoration InputDecoration
final
duration → Duration
延迟多少时间触发onChanged方法
final
enabled → bool
final
focusNode FocusNode
final
inputFormatters → List<TextInputFormatter>
final
keyboardType TextInputType
final
maxLength → int
final
maxLengthEnforced → bool
final
maxLines → int
final
obscureText → bool
final
onChanged ValueChanged<String>
change触发方法
final
onSubmitted ValueChanged<String>
final
style TextStyle
final
textAlign TextAlign
final
textInputAction TextInputAction
final
hashCode → int
The hash code for this object.
read-only, inherited
key Key
Controls how one widget replaces another widget in the tree.
final, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

createState() → _DebounceTextFieldState
Creates the mutable state for this widget at a given location in the tree. [...]
override
createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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.debug}) → String
Returns 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 ==(dynamic other) → bool
The equality operator.
inherited