Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can get a Dart variable of a JSON/XML form element? #91

Open
BrandonRiveraGodines opened this issue Jan 4, 2021 · 1 comment
Open

Comments

@BrandonRiveraGodines
Copy link

I have a JSON file with the form and have textfields, labels, etc. How can I manipulate through dart code? It's possible make an binding xml~dart?

Regards and excuse, it's really neccesary a documentarion.

@OndrejKunc
Copy link
Owner

When you parse your JSON then the FormManager instance contains the complete tree structure of your form represented as Dart objects. It basically maps all your JSON nodes into the corresponding Dart objects.
You can obtain the root of this tree for example by using: FormElement root = FormProvider.of(context).form;
So if your root is of type Form and you want to get all children elements, you call (root as Form).children.
Normally you don't need to manipulate your tree directly like this, but instead, you can use the element parameter when writing a custom Renderer as described in the Readme.md.
Does this answer your question? What is your use case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants