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

JsonExporter creates wrong output #357

Open
rjahn opened this issue Feb 10, 2025 · 0 comments
Open

JsonExporter creates wrong output #357

rjahn opened this issue Feb 10, 2025 · 0 comments

Comments

@rjahn
Copy link

rjahn commented Feb 10, 2025

If you use

JsonText('DATA', args: {'text': 'Welcome'})

and use JsonExporter to dump json, following is the output:

{
   "type": "text",
   "args": {
      "data": "Welcome",
      "text": "Welcome"
   }
}

also:

JsonText("Welcome")

dumps:

{
   "type": "text",
   "args": {
      "data": "Welcome",
   }
}

The problem here is the dump is not as expected and if you use

Text("Welcome")

it's not possible to replace Text with JsonText because the result is not correct because the json definition requires text instead of data to show the Welcome text after reading the json template.

I tried to create my widget with standard flutter widgets and replaced standard class names with Json* class names, but this didn't work without manual changes.

Another example is:

Container(height: 10, color: Colors.red);

but not working with JsonContainer(height: 10, color: Colors.red);

My use-case is the creation of json from widget tree and not manually. There's the JsonExporter and it works so far, but I'm not sure if it should work better?

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

1 participant