flutter-databases

Installation
SKILL.md

flutter-data-layer-persistence

Goal

Architects and implements a robust, MVVM-compliant data layer in Flutter applications. Establishes a single source of truth using the Repository pattern, isolates external API and local database interactions into stateless Services, and implements optimal local caching strategies (e.g., SQLite via sqflite) based on data requirements. Assumes a pre-configured Flutter environment.

Decision Logic

Evaluate the user's data persistence requirements using the following decision tree to select the appropriate caching strategy:

  • Is the data small, simple key-value pairs (e.g., user preferences, theme settings)?
    • Yes: Use shared_preferences.
  • Is the data a large, structured, relational dataset requiring fast inserts/queries?
    • Yes: Use On-device relational databases (sqflite or drift).
  • Is the data a large, unstructured/non-relational dataset?
    • Yes: Use On-device non-relational databases (hive_ce or isar_community).
  • Is the data primarily API response caching?
    • Yes: Use a lightweight remote caching system or interceptors.
  • Is the data primarily images?
    • Yes: Use cached_network_image to store images on the file system.
  • Is the data too large for shared_preferences but doesn't require querying?
    • Yes: Use direct File System I/O.
Installs
985
Repository
flutter/skills
GitHub Stars
2.4K
First Seen
Mar 4, 2026
flutter-databases — flutter/skills