deleting conflicting outputs 1

deleting conflicting outputs

flutter pub run build_runner build --delete-conflicting-outputs

Here is what the above code is Doing:
1. We’re importing the json_annotation package.
2. We’re creating a part file that will hold all the generated code for this file.
3. We’re creating a class that will hold the data we want to parse from the JSON.
4. We’re using the @JsonSerializable() annotation to tell the json_annotation package that we want it to generate code for this class.
5. We’re using the @JsonKey() annotation to tell the json_annotation package how to map the JSON keys to the properties in our class.
6. We’re using the factory keyword to tell the json_annotation package that we want it to generate a constructor that will create an instance of this class from a JSON object.
7. We’re using the fromJson() method to tell the json_annotation package that we want it to generate a method that will create an instance of this class from a JSON object.
8. We’re using the toJson() method to tell the json_annotation package that we want it to generate a method that will create a JSON object from an instance of this class.

Similar Posts