Objectbox Inspector for Objectbox

pub package

This package provides a visual interface for all the classes annotated with @Entity in ObjectBox.

Folked from pub package

Features

  • x view boxes
  • x auto navigate to related entities
  • x view entities
  • x Edit non-relation & non-final entity properties
  • x Query entities by fields

Limitations

There are some types that the editor DOES NOT support yet.

  • Int8List
  • Uint8List
  • Int16List
  • Uint16List
  • Int32List
  • Uint32List
  • Int64List
  • Uint64List
  • Float32List
  • Float64List

Also the int and double have the signed functionality, and this editor does not disable it for unsigned PropertyType's. described here.

Note: they are still viewable.

The Search is not complete yet. It only supports basic types.

  • String
  • int
  • double
  • bool

Usage

To use the Objectbox Inspector, you need to add the objectbox_inspector and objectbox_inspector_generator dependency to your project.

Note: Obviosly objectbox itself is required.

dependencies:
  objectbox_inspector_plus: latest

dev_dependencies:
  objectbox_inspector_generator_plus: latest

After running flutter pub get, you can run the objectbox_inspector command to generate the inspector.

flutter pub get

To generate the inspector data, run:

dart run build_runner build --delete-conflicting-outputs

This will generate a objectbox.inspector.g.dart file in your project. That contains the necessary code to run the inspector.

Sometimes the newly added fields are not detected by build runner. In that case you can clean the build and build again.

dart run build_runner clean
dart run build_runner build --delete-conflicting-outputs

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 ToMany relation preview (for now).

"Buy Me A Coffee"