Agent skill

Flutter Caching Data

by btwld in btwld/superdeck

Implements caching strategies for Flutter apps to improve performance and offline support.

BSD-3-ClauseAuto-check passedMobile

Install Flutter Caching Data

skills CLI
$ npx skills add btwld/superdeck --skill flutter-caching-data -a claude-code

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

GitHub CLI
$ gh skill install btwld/superdeck flutter-caching-data --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-caching-data .claude/skills/flutter-caching-data && 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-caching-data
GitHub stars
129
Token cost
~2k tokens
SKILL.md length
705 words
Files
1
Skills in repo
23
Repo updated
First seen
Licence
BSD-3-Clause

At a glance

Implements caching strategies for Flutter apps to improve performance and offline support.

  • Works in 3 steps: Instantiate and pre-warm the engine in… → Store it in the FlutterEngineCache. → Retrieve it using withCachedEngine in…
  • Retaining app data locally to reduce network requests
  • SKILL.md covers Contents, Selecting a Caching Strategy, Implementing Offline-First… and Managing File System and…, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Flutter Caching Data is an agent skill from btwld/superdeck. Implements caching strategies for Flutter apps to improve performance and offline support. Use when retaining app data locally to reduce network requests or speed up startup.

Its SKILL.md is about 2k 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 Caching and Cross-platform mobile apps. It works with Flutter, SQLite and Android. The repository describes itself as: Presentation slides for Flutter with Flutter. The licence is BSD-3-Clause.

When your agent uses it

  • Retaining app data locally to reduce network requests
  • Speed up startup

Example prompts

  • “Use the flutter-caching-data skill to implement caching strategies for Flutter apps to improve performance and offline support”
  • “/flutter-caching-data”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Instantiate and pre-warm the engine in the Application class.
  2. Store it in the FlutterEngineCache.
  3. Retrieve it using withCachedEngine in the FlutterActivity or FlutterFragment.

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 and kotlin).

    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 Caching Data loads about 2k tokens when it runs. Until then it costs about 49 tokens; SKILL.md has 705 words of instructions outside code blocks.

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

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). 705 words, ~1,977 tokens.

Download SKILL.mdSave it as .claude/skills/flutter-caching-data/SKILL.md (or your agent's skills folder).
name
flutter-caching-data
description
Implements caching strategies for Flutter apps to improve performance and offline support. Use when retaining app data locally to reduce network requests or speed up startup.
metadata.model
models/gemini-3.1-pro-preview
metadata.last_modified
Thu, 12 Mar 2026 22:19:54 GMT

Implementing Flutter Caching and Offline-First Architectures

Contents

Selecting a Caching Strategy

Apply the appropriate caching mechanism based on the data lifecycle and size requirements.

  • If storing small, non-critical UI states or preferences: Use shared_preferences.
  • If storing large, structured datasets: Use on-device databases (SQLite via sqflite, Drift, Hive CE, or Isar).
  • If storing binary data or large media: Use file system caching via path_provider.
  • If retaining user session state (navigation, scroll positions): Implement Flutter's built-in state restoration to sync the Element tree with the engine.
  • If optimizing Android initialization: Pre-warm and cache the FlutterEngine.

Implementing Offline-First Data Synchronization

Design repositories as the single source of truth, combining local databases and remote API clients.

Read Operations (Stream Approach)

Yield local data immediately for fast UI rendering, then fetch remote data, update the local cache, and yield the fresh data.

dart
Stream<UserProfile> getUserProfile() async* {
  // 1. Yield local cache first
  final localProfile = await _databaseService.fetchUserProfile();
  if (localProfile != null) yield localProfile;

  // 2. Fetch remote, update cache, yield fresh data
  try {
    final remoteProfile = await _apiClientService.getUserProfile();
    await _databaseService.updateUserProfile(remoteProfile);
    yield remoteProfile;
  } catch (e) {
    // Handle network failure; UI already has local data
  }
}
Write Operations

Determine the write strategy based on data criticality:

  • If strict server synchronization is required (Online-only): Attempt the API call first. Only update the local database if the API call succeeds.
  • If offline availability is prioritized (Offline-first): Write to the local database immediately. Attempt the API call. If the API call fails, flag the local record for background synchronization.
Background Synchronization

Add a synchronized boolean flag to your data models. Run a periodic background task (e.g., via workmanager or a Timer) to push unsynchronized local changes to the server.

Managing File System and SQLite Persistence

File System Caching

Use path_provider to locate the correct directory.

  • Use getApplicationDocumentsDirectory() for persistent data.
  • Use getTemporaryDirectory() for cache data the OS can clear.
dart
Future<File> get _localFile async {
  final directory = await getApplicationDocumentsDirectory();
  return File('${directory.path}/cache.txt');
}
SQLite Persistence

Use sqflite for relational data caching. Always use whereArgs to prevent SQL injection.

dart
Future<void> updateCachedRecord(Record record) async {
  final db = await database;
  await db.update(
    'records',
    record.toMap(),
    where: 'id = ?',
    whereArgs: [record.id], // NEVER use string interpolation here
  );
}

Optimizing UI, Scroll, and Image Caching

Image Caching

Image I/O and decompression are expensive.

  • Use the cached_network_image package to handle file-system caching of remote images.
  • Custom ImageProviders: If implementing a custom ImageProvider, override createStream() and resolveStreamForKey() instead of the deprecated resolve() method.
  • Cache Sizing: The ImageCache.maxByteSize no longer automatically expands for large images. If loading images larger than the default cache size, manually increase ImageCache.maxByteSize or subclass ImageCache to implement custom eviction logic.
Scroll Caching

When configuring caching for scrollable widgets (ListView, GridView, Viewport), use the scrollCacheExtent property with a ScrollCacheExtent object. Do not use the deprecated cacheExtent and cacheExtentStyle properties.

dart
// Correct implementation
ListView(
  scrollCacheExtent: const ScrollCacheExtent.pixels(500.0),
  children: // ...
)

Viewport(
  scrollCacheExtent: const ScrollCacheExtent.viewport(0.5),
  slivers: // ...
)
Show full SKILL.md (307 more words)Show less
Widget Caching
  • Avoid overriding operator == on Widget objects. It causes O(N²) behavior during rebuilds.
  • Exception: You may override operator == only on leaf widgets (no children) where comparing properties is significantly faster than rebuilding, and the properties rarely change.
  • Prefer using const constructors to allow the framework to short-circuit rebuilds automatically.

Caching the FlutterEngine (Android)

To eliminate the non-trivial warm-up time of a FlutterEngine when adding Flutter to an existing Android app, pre-warm and cache the engine.

  1. Instantiate and pre-warm the engine in the Application class.
  2. Store it in the FlutterEngineCache.
  3. Retrieve it using withCachedEngine in the FlutterActivity or FlutterFragment.
kotlin
// 1. Pre-warm in Application class
val flutterEngine = FlutterEngine(this)
flutterEngine.navigationChannel.setInitialRoute("/cached_route")
flutterEngine.dartExecutor.executeDartEntrypoint(DartEntrypoint.createDefault())

// 2. Cache the engine
FlutterEngineCache.getInstance().put("my_engine_id", flutterEngine)

// 3. Use in Activity/Fragment
startActivity(
  FlutterActivity.withCachedEngine("my_engine_id").build(this)
)

Note: You cannot set an initial route via the Activity/Fragment builder when using a cached engine. Set the initial route on the engine's navigation channel before executing the Dart entrypoint.

Workflows

Workflow: Implementing an Offline-First Repository

Follow these steps to implement a robust offline-first data layer.

  • Task Progress:
    • Define the data model with a synchronized boolean flag (default false).
    • Implement the local DatabaseService (SQLite/Hive) with CRUD operations.
    • Implement the remote ApiClientService for network requests.
    • Create the Repository class combining both services.
    • Implement the read method returning a Stream<T> (yield local, fetch remote, update local, yield remote).
    • Implement the write method (write local, attempt remote, update synchronized flag).
    • Implement a background sync function to process records where synchronized == false.
    • Run validator -> review errors -> fix (Test offline behavior by disabling network).
Workflow: Pre-warming the Android FlutterEngine

Follow these steps to cache the FlutterEngine for seamless Android integration.

  • Task Progress:
    • Locate the Android Application class (create one if it doesn't exist and register in AndroidManifest.xml).
    • Instantiate a new FlutterEngine.
    • (Optional) Set the initial route via navigationChannel.setInitialRoute().
    • Execute the Dart entrypoint via dartExecutor.executeDartEntrypoint().
    • Store the engine in FlutterEngineCache.getInstance().put().
    • Update the target FlutterActivity or FlutterFragment to use .withCachedEngine("id").
    • Run validator -> review errors -> fix (Verify no blank screen appears during transition).

© 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-caching-data of btwld/superdeck.

Open the folder on GitHubat commit 815a746

Compare with similar skills

Flutter Caching Data 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 Caching Data compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Flutter Caching Data this skillbtwld/superdeck129—~2kAutomated safety check: PassBSD-3-Clause
Mobile App Builderrevfactory/harness-1001.3k—~1.8kAutomated safety check: PassApache-2.0
Frb Android Emulator Preparefzyzcjy/flutter_rust_bridge5.4k—~2.1kAutomated safety check: NotesMIT
Claude Android NinjaDrjacky/claude-android-ninja124—~5.2kAutomated safety check: PassApache-2.0
Web3authWeb3Auth/web3auth-examples144—~1.4kAutomated safety check: PassMIT
SimdeckNativeScript/SimDeck152—~3.6kAutomated safety check: PassMIT

Similar skills

  • Mobile App Builder

    revfactory/harness-100

    Full mobile app development pipeline. An agent skill from revfactory/harness-100.

    1.3k GitHub stars~1.8k tokensUpdated 6 mo ago
    MobileAuto-check passed
  • Frb Android Emulator Prepare

    fzyzcjy/flutter_rust_bridge

    A skill your agent uses when preparing, installing, diagnosing, or explaining the host Android Emulator environment for flutterrustbridge local runtime validation, including Android SDK command-line…

    5.4k GitHub stars~2.1k tokensUpdated yesterday
    MobileAuto-check: notes
  • Claude Android Ninja

    Drjacky/claude-android-ninja

    Build and migrate Android apps with Kotlin, Jetpack Compose, MVVM, Hilt, Room 3 (KSP, SQLiteDriver, Flow/suspend DAOs), Navigation3, and multi-module Gradle.

    124 GitHub stars~5.2k tokensUpdated 8 days ago
    MobileAuto-check passed
  • Web3auth

    Web3Auth/web3auth-examples

    Integrates MetaMask Embedded Wallets (Web3Auth) for non-custodial wallets via social login or custom JWT (Firebase, Auth0, Cognito).

    144 GitHub stars~1.4k tokensUpdated 4 days ago
    Backend & APIsAuto-check passed
  • Simdeck

    NativeScript/SimDeck

    A skill your agent uses for simulator lifecycle, app install/launch, live viewing, UI inspection, touch/keyboard automation, screenshots, recordings, logs, pasteboard, hardware controls, and…

    152 GitHub stars~3.6k tokensUpdated 26 days ago
    MobileAuto-check passed
  • Detour Onboarding

    software-mansion-labs/skills

    Complete onboarding guide for developers who are new to Detour, the open-source deferred deep linking SDK by Software Mansion.

    291 GitHub stars~2.8k tokensUpdated 9 days ago
    MobileAuto-check passed

More from btwld/superdeck

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

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

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

    btwld/superdeck

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

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

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

    btwld/superdeck

    Builds Flutter forms with validation and user input handling.

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

    129 GitHub stars~1.5k tokensUpdated 9 days ago
    Auto-check passed

Questions about Flutter Caching Data

What does Flutter Caching Data do?

Implements caching strategies for Flutter apps to improve performance and offline support. Flutter Caching Data is an agent skill from btwld/superdeck. Implements caching strategies for Flutter apps to improve performance and offline support.

When should I use Flutter Caching Data?

Flutter Caching Data fits situations like: retaining app data locally to reduce network requests; speed up startup.

How do I install Flutter Caching Data in Claude Code?

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

How do I install Flutter Caching Data in Codex?

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

Can I use Flutter Caching Data 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-caching-data -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-caching-data, .gemini/skills/flutter-caching-data, .github/skills/flutter-caching-data and .opencode/skills/flutter-caching-data in your project.

What does Flutter Caching Data need to run?

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

Does Flutter Caching Data 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 Caching Data 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 Caching Data use?

Flutter Caching Data 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 Caching Data use?

About 2k tokens (SKILL.md is roughly 7.9k 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 Caching Data?

Skills that share tags, products or a category with Flutter Caching Data: Mobile App Builder (revfactory/harness-100, 1.3k stars), Frb Android Emulator Prepare (fzyzcjy/flutter_rust_bridge, 5.4k stars), Claude Android Ninja (Drjacky/claude-android-ninja, 124 stars) and Web3auth (Web3Auth/web3auth-examples, 144 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Flutter Caching Data?

btwld (a GitHub organization) maintains it in btwld/superdeck, which has 129 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.