asteroid-studios / jolt

Jolt is a UI Framework for Flutter - Built as an alternative to Material & Cupertino
https://flutterjolt.dev
MIT License
3 stars 0 forks source link

Better Type-Safe Forms #3

Open k-ane opened 5 months ago

k-ane commented 5 months ago

Right now can create a form model using freezed, this creates the to/from json methods and after validating the form we can get the form from the value using from json.

I would like to be able to add a type to the form like

Form

MyForm must implement fromJson

This way when returning the value, it can already be of the correct type.

Even better still, id like to utilise the build runner to generate keys from the form model.

That way when supplying the name for a TextField you could use MyForm.key.firstName

k-ane commented 5 months ago

I should check docs for jsonserializable to see if making the json keys accessible is already an option

image