dispose method
Release any resources held by this node.
Implementation
@override
void dispose() async {
if (isConnected) {
parentNode?.removeChild(this);
}
if (this is! Document && !managedByFlutterWidget) {
assert(!isRendererAttachedToSegmentTree, 'Should unmount $this before calling dispose.');
}
super.dispose();
}