Skip to content
pubscout

conduit_codable

7.0.0, released 6 months ago by theconduit.dev

A library for encoding and decoding dynamic structured data like JSON and YAML into Dart objects.

WASM-ready
$ flutter pub add conduit_codable
Source repository

What it does

It converts dynamic and structured data formats like JSON and YAML into typed Dart objects by extending a `Coding` base class. It handles object references, cyclical data, and dynamic type casting for collections like lists and maps.

AI-written summary of version 7.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to serialize and deserialize complex JSON or YAML data structures into custom Dart classes manually.
  • You are dealing with document references or cyclical data graphs in structured formats.
  • You prefer runtime serialization logic over code generation tools.

Skip it when

  • You prefer compile-time code generation for your JSON models.
  • You want a lightweight, zero-boilerplate serialization solution.

Strengths

  • Supports decoding and encoding of nested custom objects, lists, and maps.
  • Handles document references ($ref) and cyclical data structures natively.
  • Provides built-in type coercion and casting support for primitive type arguments.

Weaknesses

  • Requires manual implementation of encode and decode methods for every class.
  • Minimum Dart SDK requirement is relatively strict (>=3.12.0).

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1

not documented

class Person extends Coding {
  String name;

  @override
  void decode(KeyedArchive object) {
    super.decode(object);
    name = object.decode("name");   
  }

  @override
  void encode(KeyedArchive object) {
    object.encode("name", name);
  }
}

Alternatives

Packages that do the same job and could replace conduit_codable.

  • json_annotation

    Provides compile-time JSON serialization using code generation instead of manual runtime decoding methods.

  • built_value

    Provides immutable value types and builder patterns with robust code generation for serialization.

  • freezed_annotation

    Generates immutable union and data classes with built-in JSON serialization capabilities.

Works with

Packages commonly used together with conduit_codable: ones it builds on, ones built on it, and its own family.