notify method

  1. @override
void notify()

Notifies the consumer that one of its dependencies has changed.

Implementation

@override
void notify() {
  final element = _state.elementRef.target;
  if (element == null || !element.mounted) {
    // The element is dead or unmounted, unsubscribe immediately
    node.removeObserver(this);
  } else {
    _state.beginBuildCycle();
    element.markNeedsBuild();
  }
}