def METHOD_NAME(self, widget: Widget) -> None:
    """Append a Widget.
    Args:
        widget: A widget.
    """
    if widget not in self._nodes_set:
        self._nodes.append(widget)
        self._nodes_set.add(widget)
        widget_id = widget.id
        if widget_id is not None:
            self._ensure_unique_id(widget_id)
            self._nodes_by_id[widget_id] = widget
        self._updates += 1