onChildrenChanged method

  1. @mustCallSuper
  2. @override
void onChildrenChanged(
  1. Component child,
  2. ChildrenChangeType type
)
override

This method will be invoked from lifecycle if child has been added to or removed from its parent children list.

Implementation

@mustCallSuper
@override
void onChildrenChanged(Component child, ChildrenChangeType type) {
  if (_child?.parent != this) {
    this.child = null;
  }
}