smart_debug_overlay

A floating debug overlay for real-time logs, network requests, and app state monitoring.

Features

  • A floating debug overlay for real-time logs, network requests, and app state monitoring.

Getting started

To use this package, add smart_debug_overlay as a dependency in your pubspec.yaml file.

Usage

Minimal example:

    void main() {
        runApp(
            MultiProvider(
            providers: [
                ChangeNotifierProvider(create: (_) => DebugService()),
            ],
            child: MyApp(),
            ),
        );
    }

    class MyApp extends StatelessWidget {
        @override
        Widget build(BuildContext context) {
            return MaterialApp(
            debugShowCheckedModeBanner: false,
            home: HomeScreen(),
            );
        }
    }
    class HomeScreen extends StatelessWidget {
        @override
        Widget build(BuildContext context) {
            final debugService = Provider.of<DebugService>(context, listen: false);

            return Stack(
            children: [
                Scaffold(
                appBar: AppBar(title: Text("Debug Overlay Example")),
                body: Center(
                    child: ElevatedButton(
                    onPressed: () {
                        debugService.addLog("User clicked the button!", type: "log");
                    },
                    child: Text("Log Event"),
                    ),
                ),
                ),
                DebugOverlay(),
            ],
            );
        }
    }