1212 </a>
1313</h1 >
1414
15- DOGs, short for Dart Object Graphs, is a object mapping and serialization library that use
16- code generation to create a structure definition of your serializable classes, which is usable at
17- runtime.
15+ DOGs (Dart Object Graphs) is a serialization and object-mapping library for Dart that turns your classes into
16+ introspectable, immutable, and easily validated data models across multiple formats.
1817
1918[ Documentation] ( https://dogs.helight.dev ) |
2019[ Discord] ( https://discord.gg/6HKuGSzYKJ ) |
2120[ Pub Package] ( https://pub.dev/packages/dogs_core )
2221
2322``` dart
2423@serializable
25- class Person with Dataclass<Person>{
24+ class Person with Dataclass<Person> {
2625
2726 @LengthRange(max: 128)
2827 final String name;
@@ -39,82 +38,87 @@ class Person with Dataclass<Person>{
3938}
4039```
4140
42- * 🐦 ** Concise** Write expressive code with effectively zero boilerplate
43- * 🚀 ** Fast** Similar or increased performance compared to alternatives
44- * 🧩 ** Extensible** Modify and customize any part of your serialization
45- * 📦 ** Adaptive** Use one of the various formats or bring your own
41+ * 🐦 ** Concise** Define immutable dataclasses with a simple annotation and mixin. toString, equals, hashCode, and
42+ builders are generated automatically. No equatable, no copyWith, no additional boilerplate.
43+ * 🚀 ** Fast** Optimized serialization and deserialization with performance on par or better than alternatives. JSON
44+ support is built in with zero extra dependencies.
45+ * 🧩 ** Extensible**
46+ Replace or extend any part of the pipeline. Add new formats, validators, projections, or field converters. Works with
47+ custom Flutter types through the integration package.
48+ * 📦 ** Adaptive** Multiple formats supported out of the box: JSON, YAML, TOML, CBOR. Schema generation enables dynamic
49+ use cases like server-driven forms.
4650* 📚 ** Documented** Comprehensive documentation and examples
47- * ⚡ ** Unmatched DX ** No part files, no dollar signs, no getters, no hassle
48-
51+ * ⚡ ** Developer-friendly ** All generated code goes into a single dogs.g.dart. Models remain clean and free of part
52+ directives. Builders and nullable copy methods are exposed centrally.
4953
5054## Format Support
55+
5156- ** JSON** (included in dogs_core)
5257- ** YAML** <a href =" https://pub.dev/packages/dogs_yaml " ><img src =" https://img.shields.io/pub/v/dogs_yaml?label=dogs_yaml " alt =" pub " ></a >
5358- ** TOML** <a href =" https://pub.dev/packages/dogs_toml " ><img src =" https://img.shields.io/pub/v/dogs_toml?label=dogs_toml " alt =" pub " ></a >
5459- ** CBOR** <a href =" https://pub.dev/packages/dogs_cbor " ><img src =" https://img.shields.io/pub/v/dogs_cbor?label=dogs_cbor " alt =" pub " ></a >
5560
5661## Core Package <a href =" https://pub.dev/packages/dogs_core " ><img src =" https://img.shields.io/pub/v/dogs_core?label=dogs_core " alt =" pub " ></a >
62+
5763- ** Json**
5864 The core package comes with json support out of the box and requires no additional dependencies.
5965
66+ - ** Builders & Nullable Copy**
67+ We provide a nullable copy method that also works with null values, as well as autogenerated builders, similar to
68+ built_value. Both let you create immutable objects with a simple and fluent api.
6069
61- - ** Builders **
62- We provide autogenerated builders, similar to built_value, which allow you to easily create
63- immutable objects with a fluent api.
64-
70+ - ** Structures **
71+ Every serializable class has an introspectable generated ` DogStructure ` that provides runtime access to the class's
72+ fields, annotations, factories and metadata. Together with the extensible core system, you can build powerful
73+ reflection-like functionality without the need for custom code generation or mirrors.
6574
6675- ** Dataclasses**
6776 Using our dataclass mixin automatically implements toString, equals and hashCode for your
6877 serializable classes. This removes the requirement for a package like equatable or
69- ungodly amounts of boilerplate code.
70-
78+ ungodly amounts of boilerplate code, that is hard to maintain and distracting.
7179
7280- ** Projections**
73- Dogs offers a powerful projection api, which allows you to transform your objects into
74- other objects, without having to write additional boilerplate code.
75-
81+ Dogs offers a powerful projection api, which enables you to transform your objects into
82+ other objects, without having to write additional boilerplate code with brittle ` copyWith `
83+ invocations and hard coded key names.
7684
7785- ** Polymorphism**
78- Dogs supports polymorphic serialization, which allows you to serialize and deserialize
86+ Dogs supports polymorphic serialization, which enables you to serialize and deserialize
7987 objects of different types. You can even use interfaces and abstract classes as types,
8088 including ` Object ` .
8189
82-
8390- ** Validation**
8491 Using the validation api, you can easily validate your objects, without having the struggle
85- of writing your own validation logic for most common use cases.
92+ of writing your own validation logic for most common use cases. Translation of messages and
93+ custom validators are supported as well.
8694
87-
88- - ** OpenApi Schema ** (preview)
89- Dogs offers a schema generation api, which allows you to generate an OpenApi schema for your
90- objects, to be used with OpenApi tools like Swagger .
95+ - ** JsonSchema-like Schema ** (preview)
96+ Dogs offers a schema generation api, which allows you to dynamically export and parse a subset
97+ of json- schema. This enables advanced dynamic uses cases such as partially server-driven forms when used
98+ in combination with the flutter integration .
9199
92100[ Package on pub.dev] ( https://pub.dev/packages/dogs_core )
93101[ Documentation] ( https://dogs.helight.dev )
94102
95- ## Firestore <a href =" https://pub.dev/packages/dogs_firestore " ><img src =" https://img.shields.io/pub/v/dogs_firestore?label=dogs_firestore " alt =" pub " ></a >
96- Dogs offers a firestore api, which allows you to easily create firestore documents from your
97- serializable objects and vice versa. You can either use our lightweight extensions on the Firestore
98- classes or make use of our entity api, which offers you a simplified and more object oriented way of
99- interacting with firestore.
100- [ Package on pub.dev] ( https://pub.dev/packages/dogs_firestore )
101- [ Documentation] ( https://dogs.helight.dev/firestore/ )
102-
103- ## Forms <a href =" https://pub.dev/packages/dogs_forms " ><img src =" https://img.shields.io/pub/v/dogs_forms?label=dogs_forms " alt =" pub " ></a >
104- Use our forms api to easily create forms for any serializable object, without having
105- to write boilerplate code. The package uses flutter_form_builder under the hood, so you can
106- benefit from its large ecosystem of form fields.
107- [ Package on pub.dev] ( https://pub.dev/packages/dogs_forms )
108- [ Documentation] ( https://dogs.helight.dev/forms/ )
109-
110- ## ✨ Fancy Code Generation ✨
111- Dogs doesn't use part files for generated code but instead
112- generated files for all serializable classes, which then get exported in the
113- dogs.g.dart file at the root of your lib folder. This massively improves the
114- developer experience, as you ** don't** have to write ** annoying part statements** with
115- missing files everytime. In fact, you don't need do ** import anything generated** in
116- your ** model files** at all! Generally, the api of dogs is designed to be independent
117- of generated code, where it makes sense. All serialization and deserialization
118- methods don't require any reference to generated code and can be used without
119- any imports. The only exception to this are the builders, which are generated
120- for each serializable class and require the dogs.g.dart file to be imported.
103+ ## Flutter <a href =" https://pub.dev/packages/dogs_flutter " ><img src =" https://img.shields.io/pub/v/dogs_flutter?label=dogs_flutter " alt =" pub " ></a >
104+
105+ Use our flutter integration to easily create forms for any serializable object, without having
106+ to write boilerplate code. The databinding system supports all primitive field types and can easily
107+ be extended to support custom field types and layouts. This package also provides converters for
108+ commonly used flutter types, like ` Color ` , ` Offset ` , ` Size ` , ` Rect ` , etc.
109+
110+ [ Package on pub.dev] ( https://pub.dev/packages/dogs_flutter )
111+ [ Documentation] ( https://dogs.helight.dev/flutter/ )
112+
113+ ## ✨ Non-Intrusive Code Generation ✨
114+
115+ Dogs takes a different approach to generated code. Instead of scattering part files across your models,
116+ all generated output lives in a single dogs.g.dart file at the root of your lib folder. This makes development smoother
117+ and far less error-prone. No more missing part statements or fragile imports.
118+
119+ Even better: your model definitions stay clean. You never need to reference generated code inside them. The only time
120+ you’ll interact with generated code directly is when using builders, which are neatly exported through
121+ the central dogs.g.dart.
122+
123+ This design keeps Dogs non-intrusive and future-proof. While part files may be added later for flexibility,
124+ you will never be required to reference generated code from within your model definition files.
0 commit comments