watch static method

CellWatcher watch(
  1. WatchCallback watch, {
  2. dynamic key,
})

Register a callback function to be called whenever the values of the referenced cells change.

The function watch is called whenever the values of the cells referenced within the function with the call method changes. The function is always called once immediately before watch returns.

If key is not null and a CellWatcher identified by key has already been created, and has not been stopped, this CellWatcher object references the same watch function.

NOTE: CellWatcher.stop must be called on the returned object when the watch function should no longer be called.

Implementation

static CellWatcher watch(WatchCallback watch, {key}) =>
    CellWatcher(key: key)..init(watch);