Flutter: SQFLite database is not showing data in application

1.2k Views Asked by At

In my Android application, I need to add about 300 customers. As application have database import/export feature available so I decided to do insert customers on computer, instead of mobile.

Here's how I did that:

  1. Install app on mobile
  2. Exported db using export feature
  3. Inserted data using SQLite Editor tool
  4. Saved the DB
  5. Transferred on mobile and imported back

Logically, it should work but it's not working.

Export/Import Feature:

This feature does work as expected, I've tested like this:

  1. Added some dummy data
  2. Exported data on SD card
  3. Delete the App
  4. Re-install (dummy data wasn't available)
  5. Imported data back and it worked

What I noticed:

  1. The exported database zip file contains a file with same name as database but with an additional word e.g DBNAME.db-journal. When I added data in db using SQLite Editor, and save it. The -journal file was removed.

  2. As application doesn't show added data in app, but if we export db from app and open it in editor, then it shows all data.

I've even tried to remove previous -journal file, right before importing but no luck.

0

There are 0 best solutions below