json_serializable2 3.5.2 json_serializable2: ^3.5.2 copied to clipboard
Automatically generate code for converting to and from JSON by annotating Dart classes.
Use this package as a library
Depend on it
Run this command:
With Dart:
$ dart pub add json_serializable2
This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get
):
dependencies:
json_serializable2: ^3.5.2
Alternatively, your editor might support dart pub get
. Check the docs for your editor to learn more.
Import it
Now in your Dart code, you can use:
import 'package:json_serializable2/builder.dart';
import 'package:json_serializable2/json_serializable.dart';
import 'package:json_serializable2/type_helper.dart';