removeFromParent method Null safety

void removeFromParent()

Removes this display object from its parent.

Implementation

void removeFromParent() {
  parent?.removeChild(this);
}