Channeler class

The Channeler class acts as a centralized event communication manager for the complete application lifecycle. Developers can register channels, subscribe listeners, emit events, and remove subscriptions without tightly coupling unrelated application layers or manually passing references around.

Constructors

Channeler()
Returns the globally shared singleton instance of the Channeler communication manager. This prevents accidental creation of multiple independent event systems and ensures all application events remain synchronized through one centralized communication infrastructure.
factory

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

disposeChannel<T>(Channel<T> channel) → void
Completely removes an initialized communication channel together with every listener currently attached to it. This operation helps clean unused communication topics and prevents stale callback references from remaining alive unnecessarily inside the event infrastructure.
initialize<T>(List<Channel<T>> channels) → void
Registers a new communication channel into the global Channeler infrastructure. Channels must always be initialized before they can receive subscriptions or events, helping developers maintain safer communication flows and detect invalid channel usage during development.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
ping<T>(Channel<T> channel, T? data) → void
Emits new data to all listeners currently subscribed to the provided communication channel. The method validates that the channel exists before dispatching events, preventing accidental communication through invalid or forgotten channels during the application execution lifecycle.
subscribe<T>(Channel<T> channel, ChannelerCallback<T> listener) → void
Registers a listener callback for the provided communication channel. This method requires the channel to be initialized beforehand otherwise an assertion error is thrown helping developers catch invalid event subscriptions early during application development and testing phases.
toString() String
A string representation of this object.
inherited
unsubscribe<T>(Channel<T> channel, ChannelerCallback<T> listener) → void
Removes a previously registered listener from the specified channel. The method validates channel initialization before attempting removal which helps identify incorrect unsubscribe operations and prevents unintended listener management bugs during application development.

Operators

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

Static Properties

instance Channeler
Shared singleton instance responsible for maintaining all registered channels and listeners globally across the application lifecycle. Using a singleton guarantees that every feature communicates through the same centralized and synchronized event distribution system during execution.
final