Search code examples
flutterflutter-getxflutter-hive

When I close the app and open it again, it doesn't work


I have created an application to know the prices of products by reading the barcode. Prices are downloaded and stored in a hifi box. The app reloads the data every 6 hours.

The problem is that, after two or more days, when you close the application and open it again, a white screen appears, then a black screen, then the application closes and does not open unless the data is deleted.

I use:

get: ^4.6.5
  get_storage: ^2.0.3
  async_button_builder: ^2.3.0+1
  hive: ^2.2.3
  hive_flutter: ^1.1.0
  flutter_barcode_listener: ^0.1.3
  lottie: ^1.4.2
  http: ^0.13.5
  fluttertoast: ^8.0.9
  intl: ^0.17.0

I've tried deleting the data when closing the app, but I can't find a way to tell if the app is closed or not.


Solution

  • The problem was with the size of data I was storing in the hive, I was storing more than 40k items, in this case the hive was not working perfectly, but I used sqflite and it was working perfectly.