You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a simple application which flutter_form_builder to get user values and then send them to be backend with a POST method. Currently I have to do a lot of error-prone boilerplate coding to convert the Map to built_value.
It would be a lot better if there was a standardized way to serialize form_builder map to built_values.
The text was updated successfully, but these errors were encountered:
I, however, think that this would be near-impossible to achieve since each user of the package aims to use the package in their own way.
If we were to serialize the resulting map into a class object, that would mean that we would have to know the shape of the intended class - which is not possible.
There are also so many packages to convert maps to objects and using one (built_value in this case) within the package will be some form of vendor lock-in which is undesirable.
I also feel that this is not the purpose for which this package was intended and that would bring unnecessary complications to this package.
If you still feel that this is achievable and necessary to be part of the package, kindly submit a PR that will be reviewed and if possible, merged into the repo.
The Shape under consideration here is managed by build_value - using generated code for the actual implementation specifying the shape in form of Fields.
Then use the serialisation object to serialise in the specified format. static Serializer<Login> get serializer => _$loginSerializer; Serializers serializers = _$serializers;
Currently built_value has a Map based serialiser and a JSON serialiser.
So either we can use the existing serialiser (map based) to communicate with the Form Builder State or create a custom serialiser to have the specified valued in the current format.
I have a simple application which flutter_form_builder to get user values and then send them to be backend with a POST method. Currently I have to do a lot of error-prone boilerplate coding to convert the Map to built_value.
It would be a lot better if there was a standardized way to serialize form_builder map to built_values.
The text was updated successfully, but these errors were encountered: