registerNotifier method

void registerNotifier(
  1. String key, {
  2. StreamController? controler,
  3. String? scope,
  4. bool override = false,
})

Declare a new a stream events

Implementation

void registerNotifier(String key,
    {StreamController? controler, String? scope, bool override = false}) {
  String k = "${(scope ?? "main").toLowerCase()}:${key.toLowerCase()}";
  controler = controler ?? StreamController.broadcast(sync: true);
  if (override) {
    if (!_events.containsKey(k) ||
        _events[k].hashCode != controler.hashCode) {
      _events[k] = controler;
    }
  } else {
    _events[k] ??= controler;
  }
}