Overview
This package extends dart-json-mapper to support serialization and deserialization of built_collection types, such as ImmutableList, ImmutableSet, and ImmutableMap, enabling seamless JSON handling for immutable data structures in Dart applications. It integrates directly with the built_collection library, ensuring type safety and efficient conversion between JSON and Dart objects. Ideal for apps relying on immutable data patterns, it simplifies working with complex nested data models.
Use cases
- Handling immutable collections in JSON APIs
- Converting built_collection types to and from JSON
- Building type-safe data models with immutability
- Integrating with existing dart-json-mapper workflows
- Supporting reactive or state management architectures
Key features
- Built-in support for ImmutableList, ImmutableSet, ImmutableMap
- Seamless integration with dart-json-mapper
- Type-safe JSON serialization
- Automatic code generation for built_collection types
- Minimal boilerplate required
Suitable for
- Dart developers using built_collection
- Projects requiring immutable data structures
- JSON-heavy applications with complex data models
- Apps using state management with immutability
- Teams adopting clean architecture with value objects
Considerations
- Requires dart-json-mapper to be installed
- Needs code generation step
- Limited to built_collection types
- May increase build time slightly
- Dependent on correct annotation usage