unlistenSignal<T> function
- @Deprecated('use SignalsMixin in StatefulWidget')
- BuildContext context,
- ReadonlySignal<
T> signal, - void callback(), {
- String? debugLabel,
Remove all subscribers for a given signal for watchers
Implementation
@Deprecated('use SignalsMixin in StatefulWidget')
void unlistenSignal<T>(
BuildContext context,
ReadonlySignal<T> signal,
void Function() callback, {
String? debugLabel,
}) {
final ctx = context;
if (ctx is StatefulElement) {
final state = ctx.state;
if (state is SignalsMixin) {
state.unlistenSignal(signal, callback);
return;
}
}
final key = ctx.hashCode;
_elementRefs.remove(key)?.unlisten(signal, callback);
}