Debouncer class
Provides a means to wait for an action to be activated a period of time after the last input. action is the function that is run after the final period of time has elapsed. builder is the input widget or widgets that are acted upon and eventually executed the action. timeout is an optional parameter that dictates how long the application ought to wait before activating the action. debouncerKey is an optional parameter that can be used to identify a specific Debouncer widget if multiple Debouncer widgets are present in the widget tree.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- Debouncer
Constructors
Properties
- action → dynamic Function()
-
The function that is run after the final period of time has elapsed.
final
- builder → Widget Function(BuildContext context, String debouncerKey)
-
The builder function that returns a widget that will show the button or
form that will eventually activate the action.
final
- debouncerKey → String
-
A unique key to identify the Debouncer widget.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeout → Duration
-
The time to wait before activating the action.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → DebouncerState -
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
Static Methods
-
cancel(
BuildContext context, {String? debouncerKey}) → dynamic -
Attempts to find and cancel the action located in a parent widget.
context
should be the BuildContext of a child widget to a Debouncer widget.debouncerKey
is an optional key that can be used to find a specific Debouncer widget if multiple parent Debouncers exist. -
execute(
BuildContext context, {String? debouncerKey}) → dynamic -
Attempts to find and activate the action located in a parent widget to an
input.
context
should be the BuildContext of a child widget to a Debouncer widget.debouncerKey
is an optional key that can be used to find a specific Debouncer widget if multiple parent Debouncers exist. -
findDebouncerWidget(
BuildContext context, {String? debouncerKey}) → DebouncerState? -
Attempts to find the DebouncerState in a parent widget.
context
should be the BuildContext of a child widget to a Debouncer widget.debouncerKey
is an optional key that can be used to find a specific Debouncer widget if multiple parent Debouncers exist.