Worker class

A class representing a worker for executing asynchronous tasks with disposal functionality.

Constructors

Worker(Future<void> worker(), String type)
Constructs a new Worker with the provided worker callback and type.

Properties

disposed bool
Indicates whether the worker has been disposed.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
Type of the worker (e.g., debounce, interval, ever).
final
worker Future<void> Function()
Callback function representing the asynchronous task to be executed.
final

Methods

call() → void
Alias for the dispose method, allowing the Worker instance to be called directly for disposal.
dispose() → void
Disposes of the worker, cancelling its associated asynchronous task.
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