-
Notifications
You must be signed in to change notification settings - Fork 6
Home
pablichjenkov edited this page Jan 13, 2023
·
31 revisions
The best way to get started is by creating a hello world app, are you ready?
A simple node will look something like this:
class HelloWorldNode : Node() {
private val helloWorldState = HelloWorldState()
@Composable
override fun Content(modifier: Modifier) {
HelloWorldView(helloWorldState)
}
}
@Composable
private fun HelloWorldView(helloWorldState: HelloWorldState) {
val userName = helloWorldState.userName
Column(
modifier = Modifier.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally
) {
Text("Enter your name:")
OutlinedTextField(
value = userName,
onValueChange = {
helloWorldState.userName = it
}
)
Text("Great to meet you: $userName")
}
}
private class HelloWorldState {
var userName by mutableStateOf("")
}
when you run above code you will get: