Single-Screen Node
Some screens don’t need NavFlow. Render the node directly.
@Composable
fun SettingsDestination() {
val scope = rememberCoroutineScope()
val node = remember { SettingsNode(scope) }
val state by node.state.collectAsState()
SettingsScreen(state = state, onEvent = node::onEvent)
}
SettingsNodeextendsStatefulNode, so it already handles state/output.- Use
rememberto keep the node instance stable across recompositions. - Send events by calling
node.onEventdirectly. - Great for tabs like “Settings” or “Profile” where there’s no internal navigation.