Callbacks<T1, T2 extends TCallback<T1>> class

Provides a flexible and easy way to manage and execute a set of callbacks.

This class provides the following features:

  • The ability to add, remove, and check the existence of callbacks using a callback key.
  • The ability to execute all callbacks in sequence or simultaneously.
  • The ability to track the completion of the execution of all callbacks, which is useful when subsequent actions depend on the completion of all callbacks.

Constructors

Callbacks()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(TCallback<T1> callback, {dynamic callbackKey}) → void Function()
Adds a new callback.
call(dynamic callbackKey, T1 param) Future<bool>
Invokes the appropriate callback.
callAll(T1 param, {Set? include, Set exclude = const {}, dynamic onError(Object e)?}) Future<Map>
Invokes the appripriate callbacks in the collection.
clear() → void
Clears all callbacks.
exists(dynamic callbackKey) bool
Checks if the appropriate callback exists.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(dynamic callbackKey) bool
Removes the appropriate callback.
toString() String
A string representation of this object.
inherited
wait() Future<void>
Returns a Future which waits for all currently callbacks to complete.

Operators

operator ==(Object other) bool
The equality operator.
inherited