Open sultanmyrza opened 3 years ago
I don't sure if this is possible, because form use a map to fieldNames (String key
) and your values (dynamic value
).
If do you have a solution, please feel free to make comments or a pull request
I have an idea to use code generation for this, but so far I haven't gotten around to experimenting
I was just browsing so apologies if it's off-topic (thank you for developing this package!), but how about implementing the underlying Builder and State with two additional generics <K, V> for key and value, and existing widgets can be a specialization of <String, dynamic>? It's not full type safety but I think it gets close enough to be practical, e.g. K can be an enum and V a sealed enum class for ease of use.
currently
FormBuilder.initialValue(formSchema)
formSchema isMap<String, dynamic>
any plans for making "form schema" type safe?