CallbackMap<T> class
Generic callback map for managing callbacks by string keys Similar to TypeScript's CallbackMap
Constructors
Properties
-
entries
→ Iterable<
MapEntry< String, Callback< >T> > -
Get all entries
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Check if the map is empty
no setter
- isNotEmpty → bool
-
Check if the map is not empty
no setter
-
keys
→ Iterable<
String> -
Get all keys
no setter
- length → int
-
Get the number of callbacks
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
values
→ Iterable<
Callback< T> > -
Get all callbacks
no setter
Methods
-
add(
String key, Callback< T> callback) → void - Add a callback with the given key
-
clear(
) → void - Clear all callbacks
-
get(
String key) → Callback< T> ? - Get a callback by key
-
has(
String key) → bool - Check if a key exists
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
String key) → bool - Remove a callback by key Returns true if the key existed and was removed
-
serializedObject(
) → String - Serialize to JSON (only keys, as callbacks cannot be serialized)
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
String key, Callback< T> callback) → void - Update an existing callback (only if key exists)
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited