Agent skill

Flutter Working With Databases

by btwld in btwld/superdeck

Manages local data persistence using SQLite or other database solutions.

BSD-3-ClauseAuto-check passedMobile

Install Flutter Working With Databases

skills CLI
$ npx skills add btwld/superdeck --skill flutter-working-with-databases -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install btwld/superdeck flutter-working-with-databases --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/btwld/superdeck.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/flutter-working-with-databases .claude/skills/flutter-working-with-databases && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
flutter-working-with-databases
GitHub stars
130
Token cost
~2.1k tokens
SKILL.md length
650 words
Files
1
Skills in repo
23
Repo updated
First seen
Licence
BSD-3-Clause

At a glance

Manages local data persistence using SQLite or other database solutions.

  • A Flutter app needs to store
  • SKILL.md covers Contents, Core Architecture, Services Implementation and Repository Implementation, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Synchronize large amounts of structured data on the device

What it does

Flutter Working With Databases is an agent skill from btwld/superdeck. Manages local data persistence using SQLite or other database solutions. Use when a Flutter app needs to store, query, or synchronize large amounts of structured data on the device.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Mobile, covering Cross-platform mobile apps and Schema markup. It works with Flutter and SQLite. The repository describes itself as: Presentation slides for Flutter with Flutter. The licence is BSD-3-Clause.

When your agent uses it

  • A Flutter app needs to store
  • Synchronize large amounts of structured data on the device

Example prompts

  • “Use the flutter-working-with-databases skill to manage local data persistence using SQLite or other database solutions”
  • “/flutter-working-with-databases”

What it can do on your machine

Read from SKILL.md and the folder at commit 815a746. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are dart).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Flutter Working With Databases loads about 2.1k tokens when it runs. Until then it costs about 53 tokens; SKILL.md has 650 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~53
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from btwld/superdeck at commit 815a746, republished under its BSD-3-Clause licence (© btwld). 650 words, ~2,073 tokens.

Download SKILL.mdSave it as .claude/skills/flutter-working-with-databases/SKILL.md (or your agent's skills folder).
name
flutter-working-with-databases
description
Manages local data persistence using SQLite or other database solutions. Use when a Flutter app needs to store, query, or synchronize large amounts of structured data on the device.
metadata.model
models/gemini-3.1-pro-preview
metadata.last_modified
Thu, 12 Mar 2026 22:19:15 GMT

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.
  • Return raw data models or Result wrappers to the calling repository.

Services Implementation

Database Services (SQLite)

Use databases to persist and query large amounts of structured data locally.

  • Add sqflite and path packages to pubspec.yaml.
  • Use the path package to define the storage location on disk safely across platforms.
  • Define table schemas using constants to prevent typos.
  • Use id as the primary key with AUTOINCREMENT to improve query and update times.
  • Always use whereArgs in SQL queries to prevent SQL injection (e.g., where: 'id = ?', whereArgs: [id]).
API Services
  • Wrap HTTP calls (e.g., using the http package) in dedicated client classes.
  • Return asynchronous response objects (Future or Stream).
  • Handle raw JSON serialization at this level, returning API-specific data models.

Repository Implementation

Domain Models
  • Define immutable data classes (using freezed or built_value) for Domain Models.
  • Strip out backend-specific fields (like metadata or pagination tokens) that the UI does not need.
Offline-First Synchronization

Combine local and remote data sources within the repository to provide seamless offline support.

  • If reading data: Return a Stream that immediately yields the cached local data from the Database Service, performs the network request via the API Service, updates the Database Service, and then yields the fresh data.
  • If writing data (Online-only): Attempt the API Service mutation first. If successful, update the Database Service.
  • If writing data (Offline-first): Update the Database Service immediately. Attempt the API Service mutation. If the network fails, flag the local database record as synchronized: false and queue a background synchronization task.
Show full SKILL.md (263 more words)Show less

Caching Strategies

Select the appropriate caching strategy based on the data payload:

  • Small Key-Value Data: Use shared_preferences for simple app configurations, theme settings, or user preferences.
  • Large Datasets: Use relational (sqflite, drift) or non-relational (hive_ce, isar_community) on-device databases.
  • Images: Use the cached_network_image package to automatically cache remote images to the device's file system.
  • API Responses: Implement lightweight remote caching within the API Service or Repository using in-memory maps or temporary file storage.

Workflows

Workflow: Implementing a New Data Feature

Copy and track this checklist when adding a new data entity to the application.

  • Task Progress
    • Define the Domain Model (immutable, UI-focused).
    • Define the API/DB Models (raw data structures).
    • Create or update the Service(s) to handle raw data fetching/storage.
    • Create the Repository interface (abstract class).
    • Implement the Repository, injecting the required Service(s) as private dependencies.
    • Map raw Service models to the Domain Model within the Repository.
    • Expose Repository methods to the View Model.
    • Run validator -> review errors -> fix.
Workflow: Implementing SQLite Persistence

Follow this sequence to add a new SQLite table and integrate it.

  • Task Progress
    • Add sqflite and path dependencies.
    • Define table name and column constants.
    • Update the onCreate or onUpgrade method in the Database Service to execute the CREATE TABLE statement.
    • Implement insert, query, update, and delete methods in the Database Service.
    • Inject the Database Service into the target Repository.
    • Ensure the Repository calls database.open() before executing queries.

Examples

Offline-First Repository Implementation

This example demonstrates a Repository coordinating between a Database Service and an API Service using a Stream for offline-first reads.

dart
import 'dart:async';

class TodoRepository {
  TodoRepository({
    required DatabaseService databaseService,
    required ApiClientService apiClientService,
  })  : _databaseService = databaseService,
        _apiClientService = apiClientService;

  final DatabaseService _databaseService;
  final ApiClientService _apiClientService;

  /// Yields local data immediately, then fetches remote data, updates local, and yields fresh data.
  Stream<List<Todo>> observeTodos() async* {
    // 1. Yield local cached data first
    final localTodos = await _databaseService.getAllTodos();
    if (localTodos.isNotEmpty) {
      yield localTodos.map((model) => Todo.fromDbModel(model)).toList();
    }

    try {
      // 2. Fetch fresh data from API
      final remoteTodos = await _apiClientService.fetchTodos();
      
      // 3. Update local database
      await _databaseService.replaceAllTodos(remoteTodos);
      
      // 4. Yield fresh data
      yield remoteTodos.map((model) => Todo.fromApiModel(model)).toList();
    } on Exception catch (e) {
      // Handle network errors (UI will still have local data)
      // Log error or yield a specific error state if required
    }
  }

  /// Offline-first write: Save locally, then attempt remote sync.
  Future<void> createTodo(Todo todo) async {
    final dbModel = todo.toDbModel().copyWith(isSynced: false);
    
    // 1. Save locally immediately
    await _databaseService.insertTodo(dbModel);

    try {
      // 2. Attempt remote sync
      final apiModel = await _apiClientService.postTodo(todo.toApiModel());
      
      // 3. Mark as synced locally
      await _databaseService.updateTodo(
        dbModel.copyWith(id: apiModel.id, isSynced: true)
      );
    } on Exception catch (_) {
      // Leave as isSynced: false for background sync task to pick up later
    }
  }
}
SQLite Database Service Implementation

Demonstrates safe query construction using whereArgs.

dart
class DatabaseService {
  static const String _tableName = 'todos';
  static const String _colId = 'id';
  static const String _colTask = 'task';
  static const String _colIsSynced = 'is_synced';

  Database? _database;

  Future<void> open() async {
    if (_database != null) return;
    
    final dbPath = join(await getDatabasesPath(), 'app_database.db');
    _database = await openDatabase(
      dbPath,
      version: 1,
      onCreate: (db, version) {
        return db.execute(
          'CREATE TABLE $_tableName('
          '$_colId INTEGER PRIMARY KEY AUTOINCREMENT, '
          '$_colTask TEXT, '
          '$_colIsSynced INTEGER)'
        );
      },
    );
  }

  Future<void> updateTodo(TodoDbModel todo) async {
    await _database!.update(
      _tableName,
      todo.toMap(),
      where: '$_colId = ?',
      whereArgs: [todo.id], // Prevents SQL injection
    );
  }
}

© btwld, BSD-3-Clause. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/flutter-working-with-databases of btwld/superdeck.

Open the folder on GitHubat commit 815a746

Compare with similar skills

Flutter Working With Databases next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Flutter Working With Databases compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Flutter Working With Databases this skillbtwld/superdeck130—~2.1kAutomated safety check: PassBSD-3-Clause
Dart DriftMADTeacher/mad-agents-skills110—~1.2kAutomated safety check: PassMIT
Flutter DriftMADTeacher/mad-agents-skills110—~1.6kAutomated safety check: PassMIT
Engine Whats Newflutter/flutter179k—~978Automated safety check: PassBSD-3-Clause
Flutter Cherry Pickflutter/flutter179k—~1.8kAutomated safety check: PassBSD-3-Clause
Upgrade Browserflutter/flutter179k—~1.1kAutomated safety check: PassBSD-3-Clause

Similar skills

  • Dart Drift

    MADTeacher/mad-agents-skills

    Build, fix, audit, and migrate Drift persistence in Dart CLI, server-side, and non-Flutter desktop apps.

    110 GitHub stars~1.2k tokensUpdated 5 mo ago
    MobileAuto-check passed
  • Flutter Drift

    MADTeacher/mad-agents-skills

    Implement, fix, review, migrate, test, or debug Drift persistence in Flutter apps using SQLite, driftflutter, type-safe Dart queries, generated tables, StreamBuilder or Riverpod StreamProvider UI…

    110 GitHub stars~1.6k tokensUpdated 5 mo ago
    MobileAuto-check passed
  • Engine Whats New

    flutter/flutter

    Generates the "what's new" release summary and diff file for changes in the Flutter engine (//engine/src/flutter) between two releases (e.g., 3.47 vs 3.44).

    179k GitHub stars~978 tokensUpdated today
    MobileAuto-check passed
  • Flutter Cherry Pick

    flutter/flutter

    How to land a formal cherry-pick of a merged PR for the flutter/flutter repo stable or beta channel.

    179k GitHub stars~1.8k tokensUpdated today
    MobileAuto-check passed
  • Upgrade Browser

    flutter/flutter

    Upgrade browser versions (Chrome or Firefox) in the Flutter Web Engine and/or Framework tests.

    179k GitHub stars~1.1k tokensUpdated today
    MobileAuto-check passed
  • Bump Dart

    flutter/flutter

    Do not trigger automatically; only run when a user runs /bump-dart.

    179k GitHub stars~1.2k tokensUpdated today
    MobileAuto-check passed

More from btwld/superdeck

All 23 skills in this repo
  • Create, review, or edit SuperDeck Markdown presentations and Flutter presentation apps.

    130 GitHub stars~649 tokensUpdated 10 days ago
    Auto-check passed
  • Adds home screen widgets to a Flutter app for Android and iOS.

    130 GitHub stars~2.2k tokensUpdated 10 days ago
    Auto-check passed
  • Flutter Animating Apps

    btwld/superdeck

    Implements animated effects, transitions, and motion in a Flutter app.

    130 GitHub stars~1.9k tokensUpdated 10 days ago
    Auto-check passed
  • Architects a Flutter application using the recommended layered approach (UI, Logic, Data).

    130 GitHub stars~1.8k tokensUpdated 10 days ago
    Auto-check passed
  • Flutter Building Forms

    btwld/superdeck

    Builds Flutter forms with validation and user input handling.

    130 GitHub stars~1.4k tokensUpdated 10 days ago
    Auto-check passed
  • Builds Flutter layouts using the constraint system and layout widgets.

    130 GitHub stars~1.5k tokensUpdated 10 days ago
    Auto-check passed

Works with

Categories

Questions about Flutter Working With Databases

What does Flutter Working With Databases do?

Manages local data persistence using SQLite or other database solutions. Flutter Working With Databases is an agent skill from btwld/superdeck. Manages local data persistence using SQLite or other database solutions.

When should I use Flutter Working With Databases?

Flutter Working With Databases fits situations like: A Flutter app needs to store; synchronize large amounts of structured data on the device.

How do I install Flutter Working With Databases in Claude Code?

Run `npx skills add btwld/superdeck --skill flutter-working-with-databases -a claude-code`. Or copy the skill folder (.agents/skills/flutter-working-with-databases in btwld/superdeck) into .claude/skills/flutter-working-with-databases in your project. Claude Code loads it when a task matches its description.

How do I install Flutter Working With Databases in Codex?

Run `npx skills add btwld/superdeck --skill flutter-working-with-databases -a codex`. Or copy the skill folder (.agents/skills/flutter-working-with-databases in btwld/superdeck) into .agents/skills/flutter-working-with-databases in your project. Codex loads it when a task matches its description.

Can I use Flutter Working With Databases in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add btwld/superdeck --skill flutter-working-with-databases -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/flutter-working-with-databases, .gemini/skills/flutter-working-with-databases, .github/skills/flutter-working-with-databases and .opencode/skills/flutter-working-with-databases in your project.

What does Flutter Working With Databases need to run?

SKILL.md names no scripts, command-line tools or credentials: Flutter Working With Databases is instructions for the agent only.

Does Flutter Working With Databases access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Flutter Working With Databases safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Flutter Working With Databases use?

Flutter Working With Databases is published under the BSD-3-Clause licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Flutter Working With Databases use?

About 2.1k tokens (SKILL.md is roughly 8.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Flutter Working With Databases?

Skills that share tags, products or a category with Flutter Working With Databases: Dart Drift (MADTeacher/mad-agents-skills, 110 stars), Flutter Drift (MADTeacher/mad-agents-skills, 110 stars), Engine Whats New (flutter/flutter, 179k stars) and Flutter Cherry Pick (flutter/flutter, 179k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Flutter Working With Databases?

btwld (a GitHub organization) maintains it in btwld/superdeck, which has 130 GitHub stars. The repository holds 23 skills in this directory. The repository was last updated on September 28, 2026.

Source: btwld/superdeck on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.