json_serializable_immutable_collections
1.1.3, released 10 months ago by demoda.app
Extends json_serializable to support immutable collections like BuiltList and KtList.
What it does
It adds support for additional immutable collection types, including BuiltList, BuiltSet, BuiltMap, KtList, KtSet, and KtMap, when using json_serializable for code generation.
AI-written summary of version 1.1.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You use json_serializable and need to serialize BuiltValue collections
- You use json_serializable and need to serialize Kt collections
Skip it when
- You do not use code generation or json_serializable
- You only need standard Dart collections or standard json_serializable supported types
Strengths
- Enables seamless JSON serialization for immutable collections
- Integrates directly with the json_serializable ecosystem
Weaknesses
- Requires specific build.yaml configuration to avoid builder conflicts
- Unofficial package relying on json_serializable internals
Setup
- Kind
- Pure Dart
- Effort
- Medium
- Code generation
- Yes (build_runner)
- Direct dependencies
- 8
Add to dev_dependencies and configure build.yaml to prevent conflicts with the standard json_serializable builder.
dependencies:
dev_dependencies:
json_serializable_immutable_collections: <current_version>Alternatives
Packages that do the same job and could replace json_serializable_immutable_collections.
- built_value
Provides its own immutable value types and built-in serialization solution instead of relying on json_serializable.
88Compare
Works with
Packages commonly used together with json_serializable_immutable_collections: ones it builds on, ones built on it, and its own family.
- analyzerjson_serializable_immutable_collections depends on itPerforms static analysis of Dart code for tool integration and embedding.
- json_annotationjson_serializable_immutable_collections depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- buildjson_serializable_immutable_collections depends on itPackage for authoring build_runner compatible code generators.
- build_runnerjson_serializable_immutable_collections depends on itA build system for Dart code generation and modular compilation.
- source_genjson_serializable_immutable_collections depends on itSource code generation builders and utilities for the Dart build system.
- json_serializablejson_serializable_immutable_collections depends on itAutomatically generate code for converting Dart classes to and from JSON.
- json_serializable_mobxSame familyExtends json_serializable to support MobX collections like ObservableList, ObservableSet, and ObservableMap.