File tree Expand file tree Collapse file tree 4 files changed +28
-0
lines changed
objectbox/example/flutter/objectbox_demo_relations Expand file tree Collapse file tree 4 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ Update `flutter_libs` and `sync_flutter_libs` with **compatible library versions
1818 - Shortcut: search and replace ` -android:3.1.3 ` in ` build.gradle ` files.
1919 - In [ flutter_libs] ( ../flutter_libs/android/build.gradle )
2020 - In [ sync_flutter_libs] ( ../sync_flutter_libs/android/build.gradle )
21+ - Android in examples.
22+ - Shortcut: search and replace ` -android-objectbrowser:3.1.3 ` in ` build.gradle ` files.
23+ - In [ objectbox_demo_relations] ( ../objectbox/example/flutter/objectbox_demo_relations/android/app/build.gradle )
2124- Swift (iOS/macOS) ([ view releases] ( https://github.com/objectbox/objectbox-swift/releases ) )
2225 - Shortcut: search and replace e.g. ` s.dependency 'ObjectBox', '1.7.0 ` in ` .podspec ` files.
2326 - In [ flutter_libs for iOS] ( ../flutter_libs/ios/objectbox_flutter_libs.podspec )
Original file line number Diff line number Diff line change @@ -9,7 +9,9 @@ See how to:
99- create Boxes and put Objects there ([ objectbox.dart] ( lib/objectbox.dart ) )
1010- query for Objects ([ objectbox.dart] ( lib/objectbox.dart ) )
1111- create, read, update and delete Objects ([ main.dart] ( lib/main.dart ) )
12+ - add ObjectBox Admin for debug builds ([ objectbox.dart] ( lib/objectbox.dart ) , [ build.gradle] ( android/app/build.gradle ) )
1213
1314## Docs
1415- [ Getting started with ObjectBox] ( https://docs.objectbox.io/getting-started )
1516- [ How to use ObjectBox Relations] ( https://docs.objectbox.io/relations )
17+ - [ ObjectBox Admin] ( https://docs.objectbox.io/data-browser )
Original file line number Diff line number Diff line change @@ -70,6 +70,21 @@ flutter {
7070 source ' ../..'
7171}
7272
73+ // Optional: add ObjectBox Admin - https://docs.objectbox.io/data-browser
74+ // Tell Gradle to exclude the objectbox-android dependency from debug builds
75+ // that is added by objectbox_flutter_libs. Keeps it for release and profile builds.
76+ configurations {
77+ debugImplementation {
78+ exclude group : ' io.objectbox' , module : ' objectbox-android'
79+ }
80+ }
81+
7382dependencies {
7483 implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version "
84+
85+ // Optional: add ObjectBox Admin - https://docs.objectbox.io/data-browser
86+ // Add objectbox-android-objectbrowser only for debug builds.
87+ // Warning: when objectbox_flutter_libs updates check if version
88+ // needs update, e.g. check https://github.com/objectbox/objectbox-dart/releases.
89+ debugImplementation(" io.objectbox:objectbox-android-objectbrowser:3.1.3" )
7590}
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import 'objectbox.g.dart'; // created by `flutter pub run build_runner build`
77class ObjectBox {
88 /// The Store of this app.
99 late final Store store;
10+ late final Admin _admin;
1011
1112 /// Two Boxes: one for Tasks, one for Tags.
1213 late final Box <Task > taskBox;
@@ -17,6 +18,13 @@ class ObjectBox {
1718 late final Stream <Query <Tag >> tagsStream;
1819
1920 ObjectBox ._create (this .store) {
21+ // Optional: enable ObjectBox Admin on debug builds.
22+ // https://docs.objectbox.io/data-browser
23+ if (Admin .isAvailable ()) {
24+ // Keep a reference until no longer needed or manually closed.
25+ _admin = Admin (store);
26+ }
27+
2028 taskBox = Box <Task >(store);
2129 tagBox = Box <Tag >(store);
2230
You can’t perform that action at this time.
0 commit comments