didUnmountRenderObject method
This method is called when a RenderObject that was previously associated with this widget is removed from the render tree. The provided RenderObject will be of the same type as the one created by this widget's createRenderObject method.
Implementation
@override
void didUnmountRenderObject(covariant RenderObject renderObject) {
// WidgetElement can be remounted to the DOM tree and trigger widget adapter updates.
// We need to check if the widgetElement is actually disconnected before unmounting the renderWidget.
if (!widgetElement.isConnected) {
if (enableWebFProfileTracking) {
WebFProfiler.instance.startTrackUICommand();
}
widgetElement.unmountRenderObject();
if (enableWebFProfileTracking) {
WebFProfiler.instance.finishTrackUICommand();
}
}
}