A Floating Action Button appears in debug mode. Tapping it opens the primary inspector shield, featuring a modern glassmorphic UI with high-performance blur effects and real-time system mirrors.
As of v0.2.1, the Inspector is fully context-independent. It no longer requires a ScaffoldMessenger, Overlay, or MaterialLocalizations in your app tree to function, making it safe to use even in minimal app configurations.
To get the most out of the Fluxy Inspector, including the time-traveling State Snapshots, you should consistently label your fluxes and set up your entry point to conditionally wrap the app in debug mode.
import 'package:flutter/material.dart';import 'package:fluxy/fluxy.dart';// 1. Properly Labeled State (Essential for Snapshots)class AppState { static final themeMode = flux<ThemeMode>(ThemeMode.light, label: "App_ThemeMode"); static final currentUser = flux<String?>("Guest", label: "App_CurrentUser"); static final notifications = fluxList<String>([], label: "App_Notifications");}void main() async { // 2. Initialize Fluxy Kernel await Fluxy.init(); // 3. Register global error sink Fx.onError((error, stack) { Fluxy.log("CRASH_HANDLER", "ERROR", error.toString()); }); // 4. Wrap with Fluxy.debug in development const isProd = bool.fromEnvironment('dart.vm.product'); runApp( isProd ? const MainApp() : Fluxy.debug(child: const MainApp()) );}class MainApp extends StatelessWidget { const MainApp({super.key}); @override Widget build(BuildContext context) { return FluxyApp( title: "DevTools Demo", // ... other app configs ); }}
When running in debug mode, the Fluxy Inspector FAB will float over your app. Because themeMode, currentUser, and notifications all have a label, you can click "Capture Snapshot", interact with your app to change these values, and then restore the entire state matrix exactly back to where it was for instant bug reproduction.