onRemove method
Called right before the component is removed from the game.
Implementation
@override
@mustCallSuper
void onRemove() {
super.onRemove();
children.forEach((child) {
child.onRemove();
});
isPrepared = false;
isMounted = false;
_parent = null;
nextParent?.add(this);
nextParent = null;
}