Skip to content

Feature request: make it easier to start using json_serializable #14623

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

Closed
roughike opened this issue Feb 10, 2018 · 5 comments
Closed

Feature request: make it easier to start using json_serializable #14623

roughike opened this issue Feb 10, 2018 · 5 comments

Comments

@roughike
Copy link
Contributor

If json_serializable is the officially recommended JSON library for Dart / Flutter, it would make sense to make it easier to get started with it.

A live template for json_serializable models

To create a json_serializable model, some amount of boilerplate code is required from the user. A live template makes the process much more convenient.

It would look something like this:

json_serializable live template

Quick fixes for running code generation utility and adding needed dependencies

Here's the flow from the users point of view:

  • create a json_serializable model class with the live template
  • the User class has a squiggly red line under the name, saying "Code not generated yet"
  • user presses Alt-Enter and sees a quick fix option called "Generate code for json_serializable model"

By hitting enter, the following steps would be done:

  • Check if the json_serializable package is declared in pubspec file. If not, add it automatically and refresh the dependencies.
  • Run flutter packages pub run build_runner build to build the generated code.
@roughike
Copy link
Contributor Author

If somebody can point me in the right direction (and if including these kind of features makes sense), I would like to take a stab at this.

@zoechi
Copy link
Contributor

zoechi commented Feb 11, 2018

Seems related dart-lang/sdk#32103

@Hixie
Copy link
Contributor

Hixie commented May 29, 2018

@devoncarew This is an IDE feature request.

@ghost
Copy link

ghost commented Jun 12, 2018

This issue was moved by Hixie to flutter/flutter-intellij/issues/2365.

@ghost ghost closed this as completed Jun 12, 2018
@github-actions
Copy link

github-actions bot commented Sep 3, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants