pub fn widget(child: impl UiNode, id: impl IntoValue<WidgetId>) -> impl UiNode
Expand description
Create a widget node that wraps child
and introduces a new widget context. The node defines
an WIDGET
context and implements the widget in each specific node method.
This node must wrap the outer-most context node in the build, it is the WidgetBase
widget type.
The node retains the widget state if build with cfg(any(test, feature = "test_util")))
, otherwise
the state is cleared.