flutterforge_ai 0.3.0 copy "flutterforge_ai: ^0.3.0" to clipboard
flutterforge_ai: ^0.3.0 copied to clipboard

AI-Ready Flutter template with built-in DB console, API inspector, state viewer, log viewer, and AI debug snapshots. Build observable apps that AI can debug with full context.

πŸ› οΈ FlutterForge AI #

FlutterForge AI is a developer toolkit that makes Flutter apps observable and AI-debuggable β€” DB, API, state, and logs in one place, exportable as a single AI-ready JSON snapshot.

pub version pub points likes popularity CI license

One tap. One snapshot. Your AI fixes the bug.

Tap the πŸ€– button in your app, paste the generated JSON into ChatGPT / Claude / Cursor, and get an accurate fix in seconds β€” complete with the database state, API history, provider values, and logs at the moment things went wrong.

πŸ’‘ This Flutter package is one of four components. The full ecosystem also ships a CLI (flutterforge init/doctor/snapshot), a VS Code extension, and an optional self-hosted cloud receiver. See ECOSYSTEM.md for the overview.

FlutterForge AI debug workflow
(Replace doc/images/hero.gif with your own recording β€” see doc/WORKFLOW.md.)


πŸš€ 30-second workflow #

β”Œβ”€ You hit a bug ─────────────────────────────────────────────────┐
β”‚                                                                 β”‚
β”‚   1. Tap πŸ€– in your app  (or shake, or Alt+F12)                 β”‚
β”‚   2. Type the symptom:  "Login loops after OAuth refresh"       β”‚
β”‚   3. Tap "Copy AI prompt"                                       β”‚
β”‚   4. Paste into ChatGPT / Claude / Cursor                       β”‚
β”‚   5. Get a contextual fix β€” the AI sees your DB rows, last      β”‚
β”‚      API calls, current provider state, and recent logs.        β”‚
β”‚                                                                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

The snapshot is structured JSON β€” no screenshots, no guessing, no "it works on my machine".


βœ… What's actually in the box #

Not promises β€” these are shipped and covered by tests.

Capability One-call API UI
4-tab DevTools dashboard FFDevWrapper(child: ...) FFDevDashboard β€” DB / API / State / Logs
Database console + raw-SQL runner FFDbHelper.instance.database DB tab
Alice-style API inspector with cURL export FFApiClient.instance.dio API tab + detail view
Riverpod state viewer (live + history) FFStateObserver() (as ProviderScope observer) State tab
Colour-coded log viewer with filters FFLogger.info / .error / .warning / … Logs tab
AI Debug Snapshot (the killer flow) FFSnapshotGenerator.generate(problem: '...') πŸ€– FAB β†’ preview β†’ Copy AI prompt
One-tap Diagnose with AI (BYO key) FFAiClient.forConfig(config).diagnose(...) πŸ€– FAB β†’ preview β†’ "Diagnose with AI"
Sensitive-data masking automatic on all captures β€”
Release-mode auto-disable kReleaseMode gate β€”
Shake / Alt+F12 / draggable FAB triggers all wired by FFDevWrapper β€”

No vaporware section in this README. Everything above is in the latest published version on pub.dev.


✨ Why FlutterForge AI? #

Old paradigm FlutterForge AI
print() β†’ guess β†’ retry Tap button β†’ paste β†’ get fix
Hours of back-and-forth 30 seconds
Screenshot + vague prompt Structured JSON with real runtime
"It works on my machine" "Here's exactly what happened"

How it's different from Alice / Talker / pretty_dio_logger #

Capability FlutterForge AI Alice Talker pretty_dio_logger
Dio interceptor + API inspector βœ… βœ… βœ… βœ…
Colour-coded log viewer βœ… β€” βœ… β€”
Live SQLite console + raw SQL runner βœ… β€” β€” β€”
Riverpod state viewer (live + history) βœ… β€” β€” β€”
Unified 4-tab devtools dashboard βœ… β€” β€” β€”
One-tap AI debug snapshot (JSON) βœ… β€” β€” β€”
Sensitive-data masking βœ… β€” β€” β€”
Release-mode auto-disable βœ… β€” β€” β€”

FlutterForge AI is not another logger β€” it's a debugging surface that unifies every runtime signal into a single export designed for AI assistants.


πŸš€ Features #

  • πŸ—„οΈ Database Console β€” browse tables, inspect schema, run raw SQL, optional web workbench via sqflite_dev.
  • 🌐 API Inspector β€” Alice-style list of every Dio request, one-tap cURL export, sensitive header masking.
  • 🧠 State Viewer β€” Riverpod provider list with live values and a change timeline (add / update / dispose / fail).
  • πŸ“ Log Viewer β€” Talker-style colour-coded log list with level filters, search, full stack traces.
  • πŸ€– AI Debug Snapshot β€” one call bundles DB + API + State + Logs + device info into an AI-ready prompt.
  • πŸ“± Multiple triggers β€” draggable FAB, green πŸ€– FAB, shake-to-open (mobile), Alt+F12 (desktop).
  • πŸ›‘οΈ Sensitive-data masking β€” headers, body keys, and URL query params automatically redacted.
  • πŸ”’ Release-safe β€” every devtool auto-disabled in kReleaseMode.
  • πŸ§ͺ Well tested β€” 45 unit tests covering ring buffer, masker, logger, interceptor, snapshot, and prompt formatter.
  • 🌍 All platforms β€” Android, iOS, macOS, Windows, Linux, Web.

πŸ“¦ Installation #

flutter pub add flutterforge_ai

Or in pubspec.yaml:

dependencies:
  flutterforge_ai: ^0.1.1

Dependency type: dependencies (not dev_dependencies). The runtime APIs (FFLogger, FFApiClient, FFDbHelper) are called from production code paths; the devtools UI silently no-ops in release builds.


⚑ Quick start (3 lines) #

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutterforge_ai/flutterforge_ai.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  // 1. One-line init.
  await FlutterForgeAI.init(
    config: const FFConfig(appName: 'My App', baseUrl: 'https://api.example.com'),
  );

  runApp(
    ProviderScope(
      observers: [FFStateObserver()],  // 2. Track Riverpod state
      child: MaterialApp(
        // 3. Inject the devtools overlay inside MaterialApp.builder.
        builder: (ctx, child) => FFDevWrapper(child: child ?? const SizedBox()),
        home: const MyHomePage(),
      ),
    ),
  );
}

That's it. Tap the purple FAB for devtools, tap πŸ€– for an AI snapshot.


πŸ› οΈ Usage #

Make API calls (auto-captured) #

final dio = FFApiClient.instance.dio;
final resp = await dio.get('/users');

Every request appears live in the API Inspector tab with method, URL, status, duration, full request/response, and a ready-to-paste cURL command.

Log anything (auto-captured) #

FFLogger.info('User logged in');
FFLogger.error('Payment failed', error: e, stackTrace: st);

All entries show up in the Log Viewer, filterable by level (verbose β†’ fatal).

Query the database (auto-visible) #

final db = FFDbHelper.instance.database;
await db.insert('users', {'name': 'Alice'});

Open the Database Console tab to browse tables, inspect schema, and run ad-hoc SQL.

Generate an AI snapshot (one call) #

// Preferred: top-level facade on FlutterForgeAI.
final snap   = await FlutterForgeAI.generateSnapshot(problem: 'Login loop');
final prompt = FFPromptFormatter.format(snap);
await FFClipboardHelper.copy(prompt);
// Snackbar: "βœ… Prompt copied. Paste to your AI assistant."

FlutterForgeAI.generateSnapshot(...) forwards to FFSnapshotGenerator.generate(...) β€” both APIs are supported; use whichever reads better at the call site.

Or just tap the πŸ€– FAB and use the built-in preview screen.


πŸ” Configuration #

const config = FFConfig(
  appName: 'My App',
  dbName: 'my_app.db',
  baseUrl: 'https://api.example.com',
  envFile: '.env',
  enableDevTools: true,
  enableDbWorkbench: true,
  dbWorkbenchPort: 8080,
  enableAiDebugButton: true,
  enableShakeToOpen: true,
  shakeThreshold: 15.0,
  enableKeyboardShortcut: true,
  maxApiCallsStored: 200,
  maxLogsStored: 500,
  maxStateChangesStored: 300,
  sensitiveHeaders: {'authorization', 'x-api-key', 'cookie'},
  sensitiveBodyKeys: {'password', 'token', 'secret'},
  apiTimeout: Duration(seconds: 30),
  enablePrettyDioLogger: true,
  persistSnapshots: false,
  minLogLevel: FFLogLevel.verbose,
  primaryColor: Color(0xFF6366F1),
  devToolsTheme: ThemeMode.system,
);

For a release-tuned preset:

FFConfig.production(appName: 'My App');  // All devtools off, even in debug.

πŸ“Έ Screenshots #

The doc/images/ folder is the home for all recordings. Drop these four in to make the README self-explanatory:

File Shows
doc/images/hero.gif Full workflow: bug β†’ snapshot β†’ AI fix (hero).
doc/images/dashboard.png 4-tab devtools dashboard.
doc/images/api.png API Inspector with cURL export.
doc/images/snapshot.png Snapshot preview + "Copy AI prompt" button.

See doc/WORKFLOW.md for the step-by-step script.


πŸ—οΈ Architecture #

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    FlutterForgeAI.init()                    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                             β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚   β”‚ Logger β”‚  β”‚  DB   β”‚  β”‚ API/Dio  β”‚  β”‚ State Observerβ”‚    β”‚
β”‚   β””β”€β”€β”€β”¬β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”¬β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚       β–Ό           β–Ό           β–Ό                β–Ό            β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚   β”‚Log storeβ”‚ β”‚Schema + β”‚ β”‚API storeβ”‚   β”‚State storeβ”‚       β”‚
β”‚   β”‚(ring)   β”‚ β”‚SQL runr.β”‚ β”‚(ring)   β”‚   β”‚(ring)    β”‚        β”‚
β”‚   β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜        β”‚
β”‚        β–Ό           β–Ό           β–Ό              β–Ό             β”‚
β”‚       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”‚
β”‚       β”‚          FFSnapshotGenerator             β”‚          β”‚
β”‚       β”‚  β†’ AI-ready JSON via FFPromptFormatter   β”‚          β”‚
β”‚       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
                        β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚   FFDevDashboard  β”‚
              β”‚ DB β”‚ API β”‚ State β”‚ Logs
              β”‚   + πŸ€– AI button  β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

See doc/architecture.md for the deep dive.


πŸ€– The AI Debug Workflow #

  1. Your app hits a bug in development.
  2. Tap the green πŸ€– FAB (or shake, or Alt+F12 β†’ AI Snapshot).
  3. Optionally type the symptom ("Login loop after OAuth").
  4. Tap Copy AI prompt.
  5. Paste into ChatGPT / Claude / Cursor / Cody.
  6. Get a targeted, contextual fix.

Example auto-generated prompt:

I'm debugging a Flutter app. Here's the complete app context captured by
FlutterForge AI. Please analyse and suggest a fix.

PROBLEM: Login loop after OAuth

APP CONTEXT:
{
  "flutterforge_version": "0.1.1",
  "app":    { "name": "My App", "version": "1.2.3" },
  "device": { "platform": "android", "os_version": "14", "model": "Pixel 7" },
  "database": { "tables": [ … ] },
  "api_logs": {
    "recent_calls": [
      { "method": "POST", "url": "…/oauth/refresh", "status_code": 401, … }
    ]
  },
  "app_state": {
    "active_providers": [
      { "name": "authProvider", "current_value": "AuthState(token: null)" }
    ]
  },
  "logs": { "recent_entries": [ … ] }
}

Please:
1. Identify the root cause.
2. Suggest specific code fixes.
3. Point to the exact provider / API call / DB query that's failing.

❓ FAQ #

Does FlutterForge AI ship in my release build? Yes, it's imported, but every devtool, the shake detector, the floating buttons, and the snapshot generator are gated behind !kReleaseMode. In release, FFDevWrapper becomes a pass-through and FFSnapshotGenerator.generate() returns an empty snapshot.

Does the AI see my raw auth tokens? No β€” everything goes through FFSensitiveDataMasker. Authorization, Cookie, X-API-Key headers, password / token / secret body keys, and ?token= URL params are replaced with *** before the call is even stored.

Should this be a dependency or dev_dependency? Normal dependencies:. FFLogger, FFApiClient, and FFDbHelper are called from production code and must compile in release. Use FFConfig.production(appName: …) if you want every devtool silent.

Is sqflite_dev required? No. It's an optional peer dependency. Add it to your dev_dependencies and the web workbench starts on port 8080 in debug; without it, the rest of the DB features still work.

Can I use a different state manager? The package ships a Riverpod ProviderObserver. For Bloc / Provider / etc., just don't mount FFStateObserver β€” the DB / API / log surfaces stay useful.

Does it work on web? Yes. Native-only features (sqflite workbench, shake detection) are skipped automatically; everything else works.

How much memory does it use? Everything lives in fixed-size ring buffers you configure (maxLogsStored, maxApiCallsStored, …). Default footprint in debug is ~1 MB.

Can I persist snapshots? Set persistSnapshots: true and the last snapshot is stored via SharedPreferences. Read it back with FFSnapshotGenerator.lastPersistedJson().

How do I contribute? See .github/CONTRIBUTING.md.


πŸ—ΊοΈ Roadmap #

Shipped (this repo):

  • βœ… Flutter package (flutterforge_ai, on pub.dev)
  • βœ… CLI (flutterforge init / doctor / snapshot) β€” see cli/
  • 🟑 VS Code extension v0.2 β€” tree view + rich webview, see vscode/ (needs npm install && npm run compile to build locally)
  • 🟑 Cloud receiver scaffold β€” see cloud/ (dev-only; no auth / persistence yet β€” parked post-v1)

Up next (ordered by impact, not effort):

  1. πŸ”΄ One-tap "Diagnose with AI" β€” in-app LLM call (bring-your-own-key: Anthropic / OpenAI). The snapshot round-trips to the model and the fix streams back into the preview screen. This is the magic moment; the clipboard copy is the fallback.
  2. πŸ”΄ CLI init --auto-wire β€” run flutter pub get and patch main.dart when it matches a known shape (counter template, generated project), so "zero config" actually means zero.
  3. πŸ”΄ doctor --fix β€” apply the fixes the doctor suggests.
  4. 🟠 Inline "diff" view in the State Viewer + time-travel scrubber.
  5. 🟠 GraphQL interceptor parity.
  6. 🟠 Bloc / Provider observer adapters.
  7. 🟠 Supabase / Firebase adapters.
  8. 🟠 VS Code live mode β€” attach to a running Flutter app via DevTools Extensions, pull snapshots without picking a file.
  9. βšͺ Cloud v1 β€” auth, Postgres, agent inside the Flutter package that POSTs snapshots on uncaught error.

πŸ“„ License #

MIT Β© FlutterForge AI contributors β€” see LICENSE.

1
likes
130
points
31
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

AI-Ready Flutter template with built-in DB console, API inspector, state viewer, log viewer, and AI debug snapshots. Build observable apps that AI can debug with full context.

Repository (GitHub)
View/report issues

Topics

#debugging #devtools #ai #inspector #logging

License

MIT (license)

Dependencies

device_info_plus, dio, flutter, flutter_dotenv, flutter_riverpod, logger, package_info_plus, path, pretty_dio_logger, sensors_plus, share_plus, shared_preferences, sqflite

More

Packages that depend on flutterforge_ai