pub fn with_context_local_init<T: Any + Send + Sync + 'static>(
child: impl UiNode,
context: &'static ContextLocal<T>,
init_value: impl FnMut() -> T + Send + 'static,
) -> impl UiNode
Expand description
Helper for declaring nodes that sets a context local value generated on init.
The method calls the init_value
closure on init to produce a value var that is presented as the ContextLocal<T>
in the widget and widget descendants. The closure can be called more than once if the returned node is reinited.
Apart from the value initialization this behaves just like with_context_local
.