Skip to main content

CamoForm

Flutter's Form in Compose: the scope CamoFormFields attach to by key. validateMode is the default for fields that don't set their own; onChanged fires when any field changes. In a lazy list, revealField scrolls the row for a key into the tree so validate() can focus an off-screen field.

API​

public fun CamoForm(
state: CamoFormState,
modifier: Modifier = Modifier,
validateMode: ValidateMode = ValidateMode.Disabled,
onChanged: (() -> Unit)? = null,
revealField: (suspend (key: String) -> Unit)? = null,
content: @Composable () -> Unit,
)
NameTypeDefault
stateCamoFormStaterequired
modifierModifierModifier
validateModeValidateModeValidateMode.Disabled
onChanged(() -> Unit)?null
revealField(suspend (key: String) -> Unit)?null
content@Composable () -> Unitrequired
Design notes

Why CamoForm works this way, its states and its edge cases: contributor docs.