StepContent

@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class StepContent(val number: Int, val enabledWhen: String = "")

The StepContent annotation is used to mark the methods which are the content of a step of the Stepper component. It indicates the number of step and whether the step is enabled in specific scenarios.

@Composable
@NonRestartableComposable
@StepContent(
     number = 0,
     enabledWhen = "This step is enabled when etc..."
)
private fun Check() {
    Row(
        modifier = Modifier.fillMaxWidth(),
        verticalAlignment = Alignment.CenterVertically
    ) {
        Checkbox(
            checked = checked.value,
            onCheckedChange = { checked.value = it }
        )
        Text(
            text = "All code is okay"
        )
    }
}

Since

1.0.7

Author

N7ghtm4r3 - Tecknobit

Properties

Link copied to clipboard

enabledWhen when this step is enabled if its enabling is conditional

Link copied to clipboard
val number: Int

number the number of the step occupied in the Stepper