addEventListener method
void
addEventListener(
- NawahListenerKey event,
- dynamic filter,
- dynamic callable, {
- bool once = false,
- String? tag,
Implementation
void addEventListener(NawahListenerKey event, filter, callable, {bool once = false, String? tag}) {
Map<NawahListenerKey, dynamic> listenerObjects = {
NawahListenerKey.message: NawahMessageListener(
filter: filter,
callable: callable,
once: once,
tag: tag,
),
NawahListenerKey.connStateChange: NawahConnStateListener(
filter: filter,
callable: callable,
once: once,
tag: tag,
),
NawahListenerKey.authStateChange: NawahAuthStateListener(
filter: filter,
callable: callable,
once: once,
tag: tag,
),
};
_listeners[event]!.add(listenerObjects[event]);
}