Search packages, repositories and app categories

Package detailsv2.2.20

dart_json_mapper

This package allows programmers to annotate Dart objects in order to serialize / deserialize them from / to JSON.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
2K
Likes
279
Pub points
140

Install package

flutter pub add dart_json_mapper

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Dart Json Mapper is a code generation package that enables seamless serialization and deserialization of Dart objects to and from JSON. By using simple annotations, developers can automatically generate conversion logic, reducing boilerplate and minimizing errors. It supports complex object graphs, custom type mappings, and integrates smoothly with Flutter and other Dart platforms. The package leverages build runners to generate efficient code at compile time, ensuring high performance and type safety.

Use cases

  • Converting API responses to Dart models
  • Storing app data in JSON format
  • Synchronizing data between client and server
  • Handling nested or recursive object structures
  • Implementing configuration files as JSON
  • Enabling dynamic form data processing

Key features

  • Annotation-based code generation
  • Support for complex and nested types
  • Custom type and field mapping
  • Compile-time code generation for performance
  • Extensible plugin system
  • Integration with build_runner

Suitable for

  • Flutter developers working with APIs
  • Backend services using Dart
  • Apps requiring persistent JSON storage
  • Projects needing robust data modeling
  • Teams prioritizing type safety and maintainability
  • Developers wanting to reduce manual serialization code

Considerations

  • Requires build_runner setup
  • Generated code must be committed or regenerated on each build
  • Limited runtime reflection (uses codegen)
  • May increase build time slightly
  • Learning curve for annotation syntax
  • Not suitable for purely runtime JSON parsing

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

./mapper/README.md

Categories

Dependencies

Dependency list 9 items

Source repository

Projects using this package