Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 1.25 KB

README.md

File metadata and controls

38 lines (29 loc) · 1.25 KB

This example assumes you're using a recent version of the Dart or Flutter SDK.

To use package:json_serializable in your package, add these dependencies to your pubspec.yaml.

dependencies:
  json_annotation: ^4.9.0

dev_dependencies:
  build_runner: ^2.3.3
  json_serializable: ^6.8.0

Annotate your code with classes defined in package:json_annotation.

Run dart run build_runner build to generate files into your source directory.

> dart run build_runner build
[INFO] ensureBuildScript: Generating build script completed, took 368ms
[INFO] BuildDefinition: Reading cached asset graph completed, took 54ms
[INFO] BuildDefinition: Checking for updates since last build completed, took 663ms
[INFO] Build: Running build completed, took 10ms
[INFO] Build: Caching finalized dependency graph completed, took 44ms
[INFO] Build: Succeeded after 4687ms with 1 outputs