NaingAungLuu / form-conductor

A declarative form validation for Jetpack Compose
https://formconductor.naingaungluu.me
MIT License
59 stars 5 forks source link

How to add validation dynamically? #34

Closed jayjhaveri closed 1 year ago

jayjhaveri commented 1 year ago

Suppose the user selects US citizen: yes, then I want to mandatory some fields; how can I do this with the library?

NaingAungLuu commented 1 year ago

Hello @jayjhaveri , Such validation isn't available using form-conductor as of now. However, I'm already working on a solution for ConditionalMandatory rules for such scenarios where we dynamically evaluate isOptional value based on form state. Please stay tuned!

jayjhaveri commented 1 year ago

Hey @NaingAungLuu , thank you so much for your response. Great library, by the way. Keep it up.

NaingAungLuu commented 1 year ago

Hey @jayjhaveri! It's my pleasure to inform you that the feature you've requested is now available using @DynamicOptional annotation in version 0.4.0 🚀 Documentations are on the way too! Please use the following artifacts:

val formConductorVersion = "0.4.0"
implementation("me.naingaungluu.formconductor:core:$formConductorVersion")
implementation("me.naingaungluu.formconductor:compose-ui:$formConductorVersion")
jayjhaveri commented 1 year ago

Hey @NaingAungLuu, that's amazing. Thanks for notifying me, and eagerly waiting for your documentation.