Sqlite DB works in Flutter Android App but not in iOS

Issue

I built a simple Flutter App for Android and iOS. This app only searches for a medical term in an SQLite DB and shows the description matching for that term.

I managed to run the app on both, Android and iOS devices but with a slight difference:

In Android, the app works well, but in iOS, although I managed to run it on my iPhone device, it works only partially. When I search in some categories, it shows me the results, but in some other categories, it doesn’t. Seems like it’s maybe using the old SQLite DB? (since I updated it recently to add more terms).

Do any of you have an idea of why is this happening or have had similar problems in the past? Should I do something on iOS if I change DB content? I’m really stuck in here.

Thank you so much in advance, if you need more detail or some screenshots, just let me know.

Solution

Actually, I found it’s a known issue with the consensus being that sqflite just uses whatever the platform (iOS or Android) implementation provides, which on iOS just doesn’t handle it properly. What people do is to create a new column in their DB with the text without accents to use it for search. Then, for the results, they show the right column.

Answered By – Jose LHS

Answer Checked By – Senaida (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.