update method

void update(
  1. T fn(
    1. T
    )
)

Set $ to the return value of fn, and rebuild the dependent widgets if it changed.

Implementation

void update(T Function(T) fn) {
  $ = fn(_value);
}