DbLens class

Main entry point for DbLens.

Tiga konsep inti:

  1. Register data source — DbLens.register(...).
  2. Buat controller headless — DbLens.createController() (opsional, dipakai kalau menyusun UI sendiri lewat DbLensControllerScope).
  3. Compose widget — DbLens.open()/DbLens.buildPanel() untuk UI bawaan, atau susun widget dari package:db_lens/db_lens.dart sendiri.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

registry DbLensRegistry
Registry global — akses langsung ke semua LensDataSource terdaftar (mis. DbLens.registry.getSources()) untuk menyusun UI sendiri.
no setter

Static Methods

buildPanel({DbLensConfig? config, DbLensThemeData? theme, DbLensController? controller}) Widget
Widget inspector yang bisa di-embed di widget tree konsumen (mis. tab debug/QA aplikasi sendiri) — tanpa navigasi.
configureHistory({bool? enabled, Duration? pollInterval}) → void
Configure change-history tracking. No-op in release builds.
createController({DbLensConfig? config}) DbLensController
Buat controller headless untuk UI custom (lewat DbLensControllerScope) atau untuk dipakai bersama buildPanel.
createHistoryController() DbLensHistoryController
Create a history controller for DbLensHistoryPanel / DbLensHistorySheet.
executeStatement(String source, String sql) Future<void>
Eksekusi perintah non-SELECT (INSERT/UPDATE/DELETE/DDL) pada sumber SQL. source boleh sourceId atau sourceName.
open(BuildContext context, {DbLensConfig? config, DbLensThemeData? theme}) Future<void>
Open the built-in DbLens panel. Tidak berjalan di release build.
register(String name, Database database) → void
Register a sqflite database with a display name.
registerSharedPreferences(String name, SharedPreferences preferences) → void
Register SharedPreferences as a data source.
registerSource(LensDataSource source) → void
Register a custom LensDataSource (source).
runRawQuery(String source, String sql) Future<List<Map<String, dynamic>>>
Jalankan SELECT arbitrer pada sumber SQL. source boleh sourceId atau sourceName. Melempar UnsupportedError untuk sumber non-SQL.
unregisterSource(String sourceId) → void
Remove a source by sourceId.