DbLens class
Main entry point for DbLens.
Tiga konsep inti:
- Register data source —
DbLens.register(...). - Buat controller headless —
DbLens.createController()(opsional, dipakai kalau menyusun UI sendiri lewatDbLensControllerScope). - Compose widget —
DbLens.open()/DbLens.buildPanel()untuk UI bawaan, atau susun widget daripackage:db_lens/db_lens.dartsendiri.
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.
sourceboleh 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
databasewith a displayname. - 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.
sourceboleh sourceId atau sourceName. Melempar UnsupportedError untuk sumber non-SQL. -
unregisterSource(
String sourceId) → void -
Remove a source by
sourceId.