Agent skill · software engineering · madteacher
flutter-drift
Implement, fix, review, migrate, test, or debug Drift persistence in Flutter apps using SQLite, drift_flutter, type-safe Dart queries, generated tables, StreamBuilder or Riverpod StreamProvider UI, write operations, transactions, schema migrations, web assets, isolate sharing, and local database testing. Use when a Flutter task mentions drift, local database storage, SQLite, reactive database streams, CRUD, schemaVersion, build_runner, drift_dev make-migrations, migration tests, or Flutter-specific database setup across mobile, web, or desktop.
Why this skill is useful
Provides specific commands and workflows for implementing and managing Drift persistence in Flutter apps, which the AI wouldn't reliably generate on its own.
What it needs
Requires dart installed locally. About 3k tokens when loaded. Last updated 2026-05-01. 104 stars on the source repository.
What this skill does
Flutter Drift Use this skill to add or repair Drift-based local persistence in Flutter apps. The skill is an operating workflow: inspect the target app first, choose only the relevant reference files, implement with current Drift APIs, and validate generated code. Core Workflow 1. Inspect the app before editing: Check pubspec.yaml, existing database files, build.yaml, state management package, target platforms, and tests. Prefer the app's current architecture and naming over the examples in this skill. 2. Add or verify dependencies with package commands instead of hardcoding versions: dart pub add drift driftflutter pathprovider dev:driftdev dev:buildrunner Add provider or flutterriverpod only when the app already uses it or the user asks for that integration. 3. Create or update the database entry point: Define tables in Dart or .drift files. Add the tables to @DriftDatabase. Open Flutter databases with driftDatabase from package:driftflutter/driftflutter.dart unless the project needs a custom executor. 4. Keep Drift calls scoped to the database object: Use database.select(database.todoItems), database.into(database.todoItems), database.update(database.todoItems), and database.delete(database.todoItems) from widgets, services, and repositories. Use bare select(todoItems) only inside GeneratedDatabase subclasses or DatabaseAccessor classes where the methods and table getters are in scope. 5. Generate code after changing Drift declarations: Run dart run buildrunner build. Treat generator errors as blockers, not optional cleanup. 6. For schema changes in an existing app, use Drift's guided migration workflow: Configure driftdev databases in build.yaml. Run dart run driftdev make-migrations before and after schema changes as needed. Bump schemaVersion, write generated step-by-step migrations, and run generated migration tests. 7. Validate before finishing: Run dart format on edited Dart files. Run flutter analyze or dart analyze for the package. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills madteacher/flutter-drift