Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dev-doc/updating-c-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Update `flutter_libs` and `sync_flutter_libs` with **compatible library versions
- Shortcut: search and replace `-android:3.1.3` in `build.gradle` files.
- In [flutter_libs](../flutter_libs/android/build.gradle)
- In [sync_flutter_libs](../sync_flutter_libs/android/build.gradle)
- Android in examples.
- Shortcut: search and replace `-android-objectbrowser:3.1.3` in `build.gradle` files.
- In [objectbox_demo_relations](../objectbox/example/flutter/objectbox_demo_relations/android/app/build.gradle)
- Swift (iOS/macOS) ([view releases](https://github.com/objectbox/objectbox-swift/releases))
- Shortcut: search and replace e.g. `s.dependency 'ObjectBox', '1.7.0` in `.podspec` files.
- In [flutter_libs for iOS](../flutter_libs/ios/objectbox_flutter_libs.podspec)
Expand Down
2 changes: 2 additions & 0 deletions objectbox/example/flutter/objectbox_demo_relations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ See how to:
- create Boxes and put Objects there ([objectbox.dart](lib/objectbox.dart))
- query for Objects ([objectbox.dart](lib/objectbox.dart))
- create, read, update and delete Objects ([main.dart](lib/main.dart))
- add ObjectBox Admin for debug builds ([objectbox.dart](lib/objectbox.dart), [build.gradle](android/app/build.gradle))

## Docs
- [Getting started with ObjectBox](https://docs.objectbox.io/getting-started)
- [How to use ObjectBox Relations](https://docs.objectbox.io/relations)
- [ObjectBox Admin](https://docs.objectbox.io/data-browser)
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,21 @@ flutter {
source '../..'
}

// Optional: add ObjectBox Admin - https://docs.objectbox.io/data-browser
// Tell Gradle to exclude the objectbox-android dependency from debug builds
// that is added by objectbox_flutter_libs. Keeps it for release and profile builds.
configurations {
debugImplementation {
exclude group: 'io.objectbox', module: 'objectbox-android'
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

// Optional: add ObjectBox Admin - https://docs.objectbox.io/data-browser
// Add objectbox-android-objectbrowser only for debug builds.
// Warning: when objectbox_flutter_libs updates check if version
// needs update, e.g. check https://github.com/objectbox/objectbox-dart/releases.
debugImplementation("io.objectbox:objectbox-android-objectbrowser:3.1.3")
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'objectbox.g.dart'; // created by `flutter pub run build_runner build`
class ObjectBox {
/// The Store of this app.
late final Store store;
late final Admin _admin;

/// Two Boxes: one for Tasks, one for Tags.
late final Box<Task> taskBox;
Expand All @@ -17,6 +18,13 @@ class ObjectBox {
late final Stream<Query<Tag>> tagsStream;

ObjectBox._create(this.store) {
// Optional: enable ObjectBox Admin on debug builds.
// https://docs.objectbox.io/data-browser
if (Admin.isAvailable()) {
// Keep a reference until no longer needed or manually closed.
_admin = Admin(store);
}

taskBox = Box<Task>(store);
tagBox = Box<Tag>(store);

Expand Down