create static method

Future<ObjectBox> create()

Create an instance of ObjectBox to use throughout the app.

Implementation

static Future<ObjectBox> create() async {
  final docsDir = await getApplicationDocumentsDirectory();
  // Future<Store> openStore() {...} is defined in the generated objectbox.g.dart
  final store = await openStore(directory: p.join(docsDir.path, "obx-example"));
  return ObjectBox._create(store);
}