get<T extends Listenable> method
Returns the first notifier of type T that matches the optional predicate or key.
if could also return a Notifier by its unique key
Implementation
T? get<T extends Listenable>({bool Function(T)? predicate, String? key}) {
for (final notifier in _notifiers) {
if (notifier is T) {
if (notifier is GaanaNotifier && key != null) {
if (notifier.key != key) continue;
}
if (predicate == null || predicate(notifier)) {
return notifier;
}
}
}
return null;
}