unyo-domain-data-layer

Define domain entities, Freezed models, and repository implementations for Unyo.

651|26|Updated Mar 24, 2024
One-click install
npx skills add https://github.com/K3vinb5/Unyo --skill unyo-domain-data-layer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unyo-domain-data-layer
Source: https://github.com/K3vinb5/Unyo/tree/main/.agents/skills/unyo-domain-data-layer
Command: npx skills add https://github.com/K3vinb5/Unyo --skill unyo-domain-data-layer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide helps teams implement a robust domain and data layer for the Unyo Flutter app, enabling clean separation between domain models, data sources, and persistence.

Core Features & Use Cases

  • Entity-based domain architecture with abstract contracts and Freezed implementations.
  • Data models that map API responses to domain objects, with JSON serialization.
  • Repository contracts and provider-driven implementations (e.g., AniList/MAL) with a clean data flow.
  • Hive adapters for local persistence and a standard pattern for code generation and barrel exports.

Quick Start

Create domain entities and Freezed models, add data model mappings for API responses, implement repository interfaces and provider-specific adapters, and wire them into the DI system.

Frequently Asked Questions about unyo-domain-data-layer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a Flutter domain data layer using Freezed and Hive?

Structure a Flutter domain data layer by defining abstract entity contracts and Freezed models, adding data model mappings for API responses, implementing repository interfaces, and wiring Hive adapters for local persistence.

What is the repository pattern in Flutter for mapping API responses to domain models?

The repository pattern in Flutter separates data sources from domain logic by defining repository contracts and provider-driven implementations that map API responses to immutable Freezed domain models.

How do I implement repository interfaces and DI-enabled implementations for an AniList or MAL provider?

Implement repository interfaces by creating abstract contracts, then build provider-specific implementations for AniList or MAL, wiring them into the dependency injection system to ensure a clean data flow.

Do I need Hive adapters and JSON serialization for local persistence in a Flutter domain layer?

Yes, you need Hive adapters and JSON serialization to enable local persistence. Hive adapters store the Freezed data models locally, while JSON serialization maps the API responses to those domain objects.

When should I use Freezed models in a Flutter domain architecture?

Use Freezed models in a Flutter domain architecture when you need immutable entity implementations, JSON serialization, and seamless integration with Hive adapters for local persistence and code generation.

What is the standard pattern for code generation and barrel exports in a Flutter data layer?

The standard pattern for code generation and barrel exports involves generating Freezed models and Hive adapters, then centralizing the exports through barrel files to maintain a clean domain architecture.