Flutter forms usually start with TextFormField.validator. That works well for one field on one screen.
The problem starts when the same rule appears in more than one place. Signup. Profile edit. Checkout. Tests.
Dust lets the model own the rule. Add Validate() to the model, put the field rule beside the field, and run dust build.
Then the form can call the generated validator helper. The model can still validate itself before submit.
Read the Dust validation guide.

Top comments (0)