remove method

  1. @override
void remove(
  1. Component component
)

Removes a component from the component tree.

This will call onRemove for the component and its children, but only if there was an onMount call previously, i.e. when removing a component that was properly mounted.

A component can be removed even before it finishes mounting, however such component cannot be added back into the tree until it at least finishes loading.

Implementation

@override
void remove(Component component) {
  if (_lastProvider == null) {
    super.remove(component);
  }
  _lastProvider?.remove(component);
}