watch method

Result<T> watch(
  1. WatcherRef ref
)

Starts watching this object for changes (i.e. Listenable.addListener) and rebuilds the widget associated with the provided WatcherRef whenever listeners are notified.

NOTE: This method must only be called from within the build method of a WatcherWidget, or a Widget that mixes in WatcherMixin / StatefulWatcherMixin.

Returns the current result (value) of this ResultNotifier.

Implementation

Result<T> watch(WatcherRef ref) {
  ref.watch(this);
  return value;
}