of<T extends FlutterReadonlySignal> static method
Retrieves the reactive signal instance of type T directly from the nearest SignalProvider.
- If
listenis true (default), the calling widget will automatically subscribe to the signal and rebuild whenever the signal's value changes. - If
listenis false, the signal is returned without establishing a subscription. Uselisten: falsewhen mutating the signal inside action callbacks.
Implementation
static T? of<T extends FlutterReadonlySignal>(
BuildContext context, {
bool listen = true,
}) {
final provider = _inheritedProviderOf<T>(context, listen: listen);
return provider?.notifier;
}