-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flutter ObjectBox does not save list item after re-opening app #518
Comments
This condition doesn't look right to me, maybe it should be void saveTask(Task? task, String text) {
if (text.isNotEmpty) {
return;
} |
Hello! I updated the code from text.isNotEmpty to text.isEmpty, and I still see that nothing is saved. Could you please take a look. Thank You |
@DktPhl2019 Based on a quick look, I don't see anything else wrong with your code. I suggest to debug it and find out if Edit: you can also configure ObjectBox Admin to help you see what's stored in the database: https://docs.objectbox.io/data-browser. |
Hello! Please review the code above. The code is returning zero or null ID which means that the code taskBox.put(task) is not creating a non-zero ID. This is the bug. Could you please fix the issue. Thank You I added the following code:
b.
|
@DktPhl2019 Then please provide a unit test that reproduces this. Then we can fix the issue. I don't have the time to debug your application. |
Hello! I am not able to run a unit test on my case b/c I don't know how to setup it properly. I can't reference the variables from the lib folder under the test folder and I am not sure how I will go from my specific case variables to the general case of taskBox.input method returning a null ID. I am kind of newbie with Flutter unit testing. I guess you could close the issue. Instead, I looked at this page: github.com/objectbox/objectbox-dart/tree/main/objectbox/example/flutter/objectbox_demo |
@DktPhl2019 The underscore class and |
Hello! I am not able to generate objectbox.g.dart file. I type: flutter pub run build_runner build Could you please check what I am missing. Thank You My Files:
|
@DktPhl2019 It looks like you did miss running the second |
The app now works. Thank You |
I have a textfield input.
Clicking Add should add the input text from the textfield to a SwitchListTile list.
Clicking Remove should remove the last item from the list.
Issue: After I add an item, close the app, and re-open the app, the item added is not saved.
I am using ObjectBox nonsql database Android Studio on Windows 11(vm: Pixel API Tiramisu)
The text was updated successfully, but these errors were encountered: