registerNotifier method
void
registerNotifier(
- String key, {
- StreamController? controler,
- String? scope,
- 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;
}
}