objectbox_inspector 0.0.9
objectbox_inspector: ^0.0.9 copied to clipboard
A visual interface for all the classes annotated with @Entity in ObjectBox.
Objectbox Inspector for Objectbox #
This package provides a visual interface for all the classes annotated with @Entity in ObjectBox.
[Objectbox Inspector Demo]
Usage #
To use the Objectbox Inspector, you need to add the objectbox_inspector and objectbox_inspector_generator dependency to your project.
Note: Obviosly
objectboxitself is required.
dependencies:
objectbox_inspector: latest
dev_dependencies:
objectbox_inspector_generator: latest
After running flutter pub get, you can run the objectbox_inspector command to generate the inspector.
flutter pub get
flutter pub run build_runner build
This will generate a objectbox.inspector.g.dart file in your project. That contains the necessary code to run the inspector.
Example #
final store = openStore(); // need the Store instance...
// ...
IconButton(
onPressed: () => openObjectboxInspector(
context,
getInspectableBoxes(store),
),
icon: const Icon(Icons.bug_report),
),
// ...
Advanced relations preview #
There might be a case where instead of the preview of the relation, you want to see the actual data.
Now for a ToOne relation you would get a default preview.
ToOne<User>(id: 1)
To override this you can override the @Entity's class toString method.
@Entity()
class User {
@override
String toString() => "User(id: $id)";
}
Note: you cannot override the
ToManyrelation preview (for now).
