Open ghost opened 6 years ago
@roughike commented on Feb 10, 2018, 11:03 AM UTC:
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 commented on Feb 11, 2018, 2:19 PM UTC:
Seems related dart-lang/sdk#32103
@Hixie commented on May 29, 2018, 6:15 PM UTC:
@devoncarew This is an IDE feature request.
I think @zoechi is right here - we'd need to see a lot more uptake of json_serializable
before we'd want to bake support for it into IDEs in a first class way. Generally extensibility - in the vein of dart-lang/sdk#32103 - seems like a good way to go.
I think integrating build_runner
would be a great first step and would help many other code-gen solutions.
Like also suggested in https://github.com/flutter/flutter/pull/16934#issuecomment-397567649
@roughike commented on Feb 10, 2018, 11:00 AM UTC:
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:
Quick fixes for running code generation utility and adding needed dependencies
Here's the flow from the users point of view:
json_serializable
model class with the live templateUser
class has a squiggly red line under the name, saying "Code not generated yet"By hitting enter, the following steps would be done:
json_serializable
package is declared in pubspec file. If not, add it automatically and refresh the dependencies.flutter packages pub run build_runner build
to build the generated code.This issue was moved by Hixie from flutter/flutter/issues/14623.