パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v10.2.0

dogs_core

DXに焦点を当てた汎用的なオブジェクトマッピングおよびシリアル化ライブラリ。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
294
いいね数
12
Pub ポイント
140

パッケージをインストール

flutter pub add dogs_core

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

dogs_core は効率的なオブジェクトマッピングとシリアライゼーションを目的とした Dart パッケージであり、開発者の体験(DX)を最優先にしています。コード生成を利用して型安全性和パフォーマンスを確保しながら、最小限のボイラープレートで Dart オブジェクトと JSON の間をスムーズに変換できます。Android、iOS、Web、macOS、Windows、Linux を含むすべての主要な Flutter ターゲットをサポートし、クロスプラットフォームでの堅牢なデータ処理が必要なアプリに最適です。API およびローカルデータモデルとの連携を簡単にし、自動的にシリアライゼーションロジックを生成します。

用途

  • APIデータの解析
  • ローカル状態管理
  • クロスプラットフォームデータの永続化
  • モデル変換
  • リアルタイムデータ同期
  • 構成の読み込み

主な機能

  • コード生成されたシリアライズ
  • ゼロランタイムオーバーヘッド
  • 型安全なマッピング
  • 最小限のボイラープレート
  • すべてのFlutterプラットフォームをサポートしています
  • 拡張可能な注釈システム

適している対象

  • 高速シリアル化を求める開発者
  • 複雑なデータモデルを持つプロジェクト
  • DXを最優先にしているチーム
  • マルチプラットフォームのFlutterアプリ
  • JSON APIに依存するアプリケーション

注意事項

  • コード生成ステップが必要です
  • アノテーションの学習曲線
  • build_runner への依存関係
  • 制限された実行時カスタマイズ
  • 動的データ構造には適していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Frosty Dart Object Graphs pub Build gitbook

DOGs (Dart Object Graphs) is a serialization and object-mapping library for Dart that turns your classes into introspectable, immutable, and easily validated data models across multiple formats.

Documentation | Discord | Pub Package

@serializable
class Person with Dataclass<Person> {

  @LengthRange(max: 128)
  final String name;

  @Minimum(18)
  final int age;

  @SizeRange(max: 16)
  @Regex("((_)?[a-z]+[A-Za-z0-9]*)+")
  final Set<String>? tags;

  Person(this.name, this.age, this.tags);

}
  • 🐦 Concise Define immutable dataclasses with a simple annotation and mixin. toString, equals, hashCode, and builders are generated automatically. No equatable, no copyWith, no additional boilerplate.
  • 🚀 Fast Optimized serialization and deserialization with performance on par or better than alternatives. JSON support is built in with zero extra dependencies.
  • 🧩 Extensible Replace or extend any part of the pipeline. Add new formats, validators, projections, or field converters. Works with custom Flutter types through the integration package.
  • 📦 Adaptive Multiple formats supported out of the box: JSON, YAML, TOML, CBOR. Schema generation enables dynamic use cases like server-driven forms.
  • 📚 Documented Comprehensive documentation and examples
  • ⚡ Developer-friendly All generated code goes into a single dogs.g.dart. Models remain clean and free of part directives. Builders and nullable copy methods are exposed centrally.

Format Support

  • JSON (included in dogs_core)
  • YAML pub
  • TOML pub
  • CBOR pub

Core Package pub

  • Json
    The core package comes with json support out of the box and requires no additional dependencies.

  • Builders & Nullable Copy
    We provide a nullable copy method that also works with null values, as well as autogenerated builders, similar to built_value. Both let you create immutable objects with a simple and fluent api.

  • Structures
    Every serializable class has an introspectable generated DogStructure that provides runtime access to the class's fields, annotations, factories and metadata. Together with the extensible core system, you can build powerful reflection-like functionality without the need for custom code generation or mirrors.

  • Dataclasses
    Using our dataclass mixin automatically implements toString, equals and hashCode for your serializable classes. This removes the requirement for a package like equatable or ungodly amounts of boilerplate code, that is hard to maintain and distracting.

  • Projections
    Dogs offers a powerful projection api, which enables you to transform your objects into other objects, without having to write additional boilerplate code with brittle copyWith invocations and hard coded key names.

  • Polymorphism
    Dogs supports polymorphic serialization, which enables you to serialize and deserialize objects of different types. You can even use interfaces and abstract classes as types, including Object.

  • Validation
    Using the validation api, you can easily validate your objects, without having the struggle of writing your own validation logic for most common use cases. Translation of messages and custom validators are supported as well.

  • JsonSchema-like Schema (preview)
    Dogs offers a schema generation api, which allows you to dynamically export and parse a subset of json-schema. This enables advanced dynamic uses cases such as partially server-driven forms when used in combination with the flutter integration.

Package on pub.dev
Documentation

Flutter pub

Use our flutter integration to easily create forms for any serializable object, without having to write boilerplate code. The databinding system supports all primitive field types and can easily be extended to support custom field types and layouts. This package also provides converters for commonly used flutter types, like Color, Offset, Size, Rect, etc.

Package on pub.dev
Documentation

✨ Non-Intrusive Code Generation ✨

Dogs takes a different approach to generated code. Instead of scattering part files across your models, all generated output lives in a single dogs.g.dart file at the root of your lib folder. This makes development smoother and far less error-prone. No more missing part statements or fragile imports.

Even better: your model definitions stay clean. You never need to reference generated code inside them. The only time you’ll interact with generated code directly is when using builders, which are neatly exported through the central dogs.g.dart.

This design keeps Dogs non-intrusive and future-proof. While part files may be added later for flexibility, you will never be required to reference generated code from within your model definition files.

カテゴリー

依存関係

依存関係一覧 4 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。