onDetach method
Called after the game has left the widget tree. This can be overridden to add logic that requires the game not be on the flutter widget tree anymore.
Implementation
@override
void onDetach() {
children.query<GameComponent>().forEach(_detachComp);
super.onDetach();
}