SignalObserveExtension<T> extension
Extension on ReadonlySignal to provide fluent observe API.
This allows calling .observe() directly on any signal for a more
ergonomic syntax:
final counter = SignalsWatch.signal(0);
// Instead of:
SignalsWatch.fromSignal(counter, builder: (value) => Text('$value'))
// You can write:
counter.observe((value) => Text('$value'))
- on
Methods
-
observe(
Widget builder(T), {Key? key, void onInit(T value)?, Function? onValueUpdated, void onAfterBuild(T value)?, void onDispose(T value)?, bool shouldRebuild(T newValue, T oldValue)?, bool shouldNotify(T newValue, T oldValue)?, bool equals(T a, T b)?, Duration? debounce, Duration? throttle, void onError(Object error, StackTrace stack)?, Widget errorBuilder(Object error)?, Widget loadingBuilder()?, String? debugLabel, bool debugPrint = false}) → SignalsWatch< T> -
Available on ReadonlySignal<
Observe this signal and rebuild when it changes.T> , provided by the SignalObserveExtension extension -
selectObserve<
S> (S selector(dynamic), Widget builder(S), {Key? key, void onInit(S value)?, Function? onValueUpdated, void onAfterBuild(S value)?, void onDispose(S value)?, bool shouldRebuild(S newValue, S oldValue)?, bool shouldNotify(S newValue, S oldValue)?, bool equals(S a, S b)?, Duration? debounce, Duration? throttle, void onError(Object error, StackTrace stack)?, Widget errorBuilder(Object error)?, Widget loadingBuilder()?, String? debugLabel, bool debugPrint = false}) → SignalsWatch< S> -
Available on ReadonlySignal<
Select a specific part of this signal's value and only rebuild when that part changes.T> , provided by the SignalObserveExtension extension -
transform<
R> (R transform(T), {Key? key, required Widget builder(R), void onInit(R value)?, Function? onValueUpdated, void onAfterBuild(R value)?, void onDispose(R value)?, bool shouldRebuild(R newValue, R oldValue)?, bool shouldNotify(R newValue, R oldValue)?, bool equals(R a, R b)?, Duration? debounce, Duration? throttle, void onError(Object error, StackTrace stack)?, Widget errorBuilder(Object error)?, Widget loadingBuilder()?, String? debugLabel, bool debugPrint = false}) → SignalsWatch< R> -
Available on ReadonlySignal<
Transform this signal's value and observe the result with error handling.T> , provided by the SignalObserveExtension extension