addObserver method

StreamSubscription addObserver(
  1. String name,
  2. YKNotificationCenterCallBack? callBack
)

Implementation

StreamSubscription addObserver(String name, YKNotificationCenterCallBack callBack) {
  return _observerStream.stream.listen((event) {
    final notification = event[name];
    if (notification != null) {
      callBack?.call(notification);
    }
  });
}