Validate before the request. Validate again on the server.
That is normal app work.
Flutter forms can catch simple mistakes before submit. The server still owns the final rule.
Dust keeps that flow clear.
The request model owns the rule. The Flutter app can call validate() before sending. The server can read the JSON body with validBody(...) and reject bad input before the handler continues.
The user gets a faster error on the app.
The server still protects the API.
The code stays in clear parts:
- request model;
- Flutter submit flow;
- server endpoint;
- server response.
Write the product rule once in the model. Use it on the path where the request moves.
Docs used: Flutter form validation, Dust Validation, Dust HTTP clients, and dust_server tutorial.

Top comments (0)