removeListener method

void removeListener(
  1. NotificationMessage_NotificationType type,
  2. void listener(
    1. NotificationMessage
    )
)

Removes a listener for a specific notification type.

type specifies the type of notification. listener is the callback function to be removed.

Implementation

void removeListener(NotificationMessage_NotificationType type, void Function(NotificationMessage) listener) {
  _listeners[type]?.remove(listener);
  if (_listeners[type]?.isEmpty ?? false) {
    _listeners.remove(type);
  }
}