flutter library

Flutter-specific API: overlay widget for opening the Drift viewer in debug builds.

Import this file in Flutter apps to use DriftViewerOverlay or DriftViewerFloatingButton:

import 'package:saropa_drift_viewer/flutter.dart';

runApp(DriftViewerOverlay(
  child: MaterialApp(home: MyHomePage()),
));

For the server API (DriftDebugServer, startDriftViewer), use either this import or package:saropa_drift_viewer/saropa_drift_viewer.dart.

Classes

DriftDebugErrorLogger
Best-practice error and message logger for the Drift debug server.
DriftViewerFloatingButton
Floating button that opens the Drift viewer in the browser or in an in-app WebView.
DriftViewerOverlay
Wraps child in a Stack and overlays a floating button in debug builds that opens the Drift viewer in the browser or WebView.

Mixins

DriftDebugServer
Debug-only HTTP server (stub when dart:io unavailable).

Extensions

StartDriftViewerExtension on Object
Convenience API for Drift apps: await myDb.startDriftViewer(...).

Properties

isDriftViewerOverlayVisible bool
Returns true when the overlay button should be shown (debug mode and server running).
no setter

Typedefs

DriftDebugGetDatabaseBytes = Future<List<int>> Function()
Optional callback that returns the raw SQLite database file bytes.
DriftDebugLoggerCallbacks = ({_ErrorCallback error, _LogCallback log})
Type for the pair of log and error callbacks returned by DriftDebugErrorLogger.callbacks.
DriftDebugOnError = void Function(Object error, StackTrace stack)
Optional callback for errors (and optional stack trace).
DriftDebugOnLog = void Function(String message)
Optional callback for log messages.
DriftDebugQuery = Future<List<Map<String, dynamic>>> Function(String sql)
Callback that runs a single SQL query and returns rows as list of maps (column name → value).