Open divyesh5Gen opened 1 year ago
Where are you calling the openBox in your app?
@milindgoel15 On Crud operation in DB
like: add, update, and get data from db.
You have to call openBox because the app runs, in the main() function before runApp. And after that you can do crud operation anywhere in the app by creating an instance of created box using Hive.box(boxname)
You mean I should open it only once when the app initializes?
You mean I should open it only once when the app initializes?
yes, it should only be initialised once in the main function.
I am getting the following error when I try to open the box
tableDeviceShadow
in my code:I have already added the
await
keyword before theHive.openBox()
function, but the error is still occurring.I have tried the following things to fix the issue:
None of these things have worked.
I am attaching a screenshot of the error message.
I would appreciate any help you can provide in resolving this issue.
Thank you.