How to make step by step wizard in compose ? Is th...
# compose
a
How to make step by step wizard in compose ? Is there any example code ?
n
I created one for my current project, unfortunately I can’t share the code here. But basically you’ll have (this is a pseudo code):
Copy code
Row { // All the steps
    steps.forEachIndexed { index, s ->
       StepItem(s, index, lastIndex)
    }
}
The
StepItem
is something like this (again, pseudo code):
Copy code
Column {
    Row (
        verticalAlignment = Alignment.CenterVertically
    ) {
       if (index != 0) DrawLine(Modifier.weight(1f)
       Box(Modifier.background(
           if (selected) colorSelected 
           else colorUnselected,
           CircleShape) {
           Text(step)
       }
       if (index != lastIndex) 
           DrawLine(Modifier.weight(1f)
    }
    Text(stepName)
}
I hope it helps you as a start point…
a
@nglauber Thank you so much ♥️ I built this
n
Awesome!!! 👏 Glad to help
❤️ 1