flutterforge_ai library
FlutterForge AI — AI-Ready Flutter template.
A single-import package exposing DB console, API inspector, state viewer, log viewer, and an AI Debug Snapshot generator.
import 'package:flutterforge_ai/flutterforge_ai.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await FlutterForgeAI.init(
config: FFConfig(appName: 'My App'),
);
runApp(
ProviderScope(
observers: [FFStateObserver()],
child: FFDevWrapper(child: MyApp()),
),
);
}
Classes
- AiSettingsScreen
- Form for the one-tap "Diagnose with AI" feature.
- DiagnoseResultScreen
- Screen that fires one diagnosis call against the configured provider and renders the streaming response (non-streaming v1 — one round-trip).
- FFAiClient
- Abstract LLM client. Implementations are provider-specific; pick one via FFAiClient.forConfig.
- FFAiConfig
- Immutable AI client configuration.
- FFAiDebugButton
- Green 🤖 FAB that triggers the AI Debug Snapshot flow.
- FFAiPrompt
- Builds the system + user prompts sent to the LLM for in-app diagnosis.
- FFAiResponse
- Result of a completed AI diagnosis call.
- FFAiSettingsStore
-
Persists the user's AI provider config via
SharedPreferences. - FFAnthropicClient
- Anthropic Claude client (Messages API).
- FFApiCall
- A single captured HTTP request + response pair.
- FFApiClient
- Singleton Dio client configured by FFConfig.
- FFApiInterceptor
- Dio interceptor that captures every request/response/error into FFApiStore.
- FFApiStore
- Ring-buffer backed store of captured FFApiCalls.
- FFBubbleOverlay
- Draggable floating bubble that stays pinned inside the screen bounds (like Alice's chat-head style trigger).
- FFClipboardHelper
- Thin wrapper over Clipboard that never throws.
- FFConfig
- Immutable configuration object passed to FlutterForgeAI.init.
- FFConstants
- Constants shared across the package.
- FFCurlExporter
-
Converts a Dio
RequestOptionsinto an equivalentcurlcommand. - FFDbColumn
- One column description returned by FFDbSchemaReader.getColumns.
- FFDbHelper
-
Singleton wrapper around
sqflitethat automatically: - FFDbQueryResult
- Result of running a raw SQL query through FFDbQueryRunner.
- FFDbQueryRunner
- Safely runs arbitrary SQL provided from the devtools UI.
- FFDbSchemaReader
-
Reads tables, columns, and row counts from a
sqfliteDatabase. - FFDevDashboard
- Four-tab devtools dashboard.
- FFDeviceInfo
- Normalised device description used in AI snapshots.
- FFDeviceInfoCollector
-
Collects device info via
device_info_plus, degrading gracefully on unsupported platforms. - FFDevWrapper
- Wraps the application root with:
- FFEmptyState
- Generic empty-state placeholder used by list screens when no data is captured yet.
- FFEnvironment
-
Thin wrapper over
flutter_dotenvthat is safe to call even when the app did not configure an env file. - FFFloatingButton
- Purple FAB that opens the FlutterForge DevTools dashboard.
- FFJsonViewer
- Renders any JSON-like value (Map/List/String/num/bool) as pretty, monospace JSON with one-tap copy-to-clipboard.
- FFKeyboardShortcut
- Global Alt+F12 hotkey wrapper.
- FFLogEntry
- A single captured log entry.
- FFLogger
- Static logger facade used by the rest of the SDK and by application code.
- FFLogLevelChip
- Small chip showing a FFLogLevel label with its semantic colour.
- FFLogStore
- Ring-buffer backed store of captured FFLogEntry instances.
- FFOpenAiClient
- OpenAI (and OpenAI-compatible) client using the Chat Completions API.
- FFPackageInfo
- Normalised package description used in snapshots.
- FFPackageInfoCollector
-
Collects package info via
package_info_plus. - FFPlatformChecker
- Cross-platform detection helpers used by features that only make sense on certain platforms (shake on mobile, keyboard shortcut on desktop, sqflite on native, etc.).
- FFPrettyPrinter
- Pretty-prints JSON-like objects with stable indentation.
- FFPromptFormatter
- Converts an FFSnapshot into a prompt tuned for AI assistants.
- FFSearchBar
- Reusable search / filter bar used on every devtools list screen.
- FFSensitiveDataMasker
- Utilities for redacting sensitive data before it is shown in the devtools UI or exported in an AI snapshot.
- FFShakeDetector
- Fires onShake when the device is shaken.
- FFSnapshot
- The structured output of FFSnapshotGenerator.generate.
- FFSnapshotGenerator
- Generates a full runtime snapshot of the app for AI debugging.
- FFStateChange
- A single captured state-change event.
- FFStateObserver
-
Riverpod
ProviderObserverthat feeds FFStateStore. - FFStateStore
- Ring-buffer backed store of captured FFStateChange events.
- FFStatusCodeChip
- Small coloured chip displaying an HTTP status code.
- FlutterForgeAI
- Main entry point to FlutterForge AI.
Enums
- FFAiProvider
- AI provider the user has configured for one-tap diagnosis.
- FFApiCallStatus
- Status of a captured API call.
- FFLogLevel
- Log severity levels.
- FFStateChangeType
- Type of state-change event captured by FFStateObserver.
Extensions
- FFAiProviderX on FFAiProvider
- Labels and helpers for FFAiProvider.
- FFLogLevelX on FFLogLevel
- Convenience helpers for the FFLogLevel enum.
Typedefs
-
FFDbCreateCallback
= Future<
void> Function(Database db, int version) -
Callback signature for
onCreatewhich only receives the new version. -
FFDbMigrationCallback
= Future<
void> Function(Database db, int oldVersion, int newVersion) -
Callback signature for
onCreate,onUpgrade, etc.
Exceptions / Errors
- FFAiException
- Exception thrown when an AI call fails.