json_to_dto 0.1.0-beta json_to_dto: ^0.1.0-beta copied to clipboard
Convert JSON to Dart DTOs and back. Automate the model creation and the toJson and fromJson methods
Use this package as a library
Depend on it
Run this command:
With Dart:
$ dart pub add json_to_dto
With Flutter:
$ flutter pub add json_to_dto
This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get
):
dependencies:
json_to_dto: ^0.1.0-beta
Alternatively, your editor might support dart pub get
or flutter pub get
. Check the docs for your editor to learn more.
Import it
Now in your Dart code, you can use:
import 'package:json_to_dto/json_to_dto.dart';