FunctionProxy class
A proxy class that provides debouncing functionality for functions.
This class allows you to wrap a function and ensure that it is not called too frequently. When the debounced function is invoked repeatedly within a short period, only the last invocation will be executed after the specified timeout.
Constructors
- FunctionProxy.new(Function? target, {int timeout = 0})
-
Creates a FunctionProxy with the specified
target
function andtimeout
. - FunctionProxy.debounce(Function target, {String? key, int timeout = 500})
-
Factory constructor to create a debounced function proxy.
factory
Properties
Methods
-
debounce(
{String? uniqueKey}) → void - Debounce the function call to prevent it from being called too frequently.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited