skills.vishalvoidskills/vishalvoid
Creative & DesignIntermediate

flutter-working-with-databases

Build a structured data layer using SQLite

Developer Setup

Setup & Installation

bash
npx skills add https://github.com/flutter/skills --skill flutter-working-with-databases

Overview

What This Skill Does

Build a structured data layer using SQLite

Application

When to use this Skill

Documentation

Show Skills.md file

Architecting the Data Layer

Contents

Core Architecture

Construct the data layer as the Single Source of Truth (SSOT) for all application data. In an MVVM architecture, the data layer represents the Model. Never update application data outside of this layer.

Separate the data layer into two distinct components: Repositories and Services.

Repositories

  • Act as the SSOT for a specific domain entity.
  • Contain business logic for data mutation, polling, caching, and offline synchronization.
  • Transform raw data models (API/DB models) into Domain Models (clean data classes containing only what the UI needs).
  • Inject Services as private members to prevent the UI layer from bypassing the repository.

Services

  • Act as stateless wrappers around external data sources (HTTP clients, SQLite databases, platform plugins).
  • Perform no business logic or data transformation beyond basic JSON serialization.
Lines 1 - 25 of 192

Recommendations

Explore other random skills

All skillsMy patterns