update method

T update(
  1. T current
)

Updates the value. This can be anything from changing a property on the value to completely replacing it, or doing nothing at all.

Implementation

T update(T current) {
  if (widget.update != null) {
    T updated = widget.update!(context, current);
    if (current != updated) {
      widget.dispose?.call(context, current);
      current = updated;
    }
  }
  return current;
}