dispose method
Called when this object is removed from the tree permanently.
Implementation
@override
void dispose() {
if (Zone.current[#isMeasuringIntrinsics] == true) {
super.dispose();
return;
}
if (widget.focusNode == null) {
_focusNode.dispose();
} else if (_attachedParent != null &&
_focusNode.parent == _attachedParent) {
_attachedParent!.removeChild(_focusNode);
} else if (_focusNode.hasFocus) {
_focusNode.unfocus();
}
_attachedParent = null;
super.dispose();
}