Remove local database after uninstalling flutter desctop app in drift(before moor)

49 views Asked by At

I am using drift package for my local database in Flutter Desctop project, and I am not be able to remove the local database after uninstalling the app.

Data still exist there, I see also shared preference data not deleted. How can I solve this problem...? if I do this manually when log out, it is working well.

Future<void> deleteEverything() async {  await customStatement('PRAGMA foreign_keys = OFF');
  try {    transaction(() async {
      for (final table in allTables) {        await delete(table).go();
      }    });
  } finally {    await customStatement('PRAGMA foreign_keys = OFF');
  }}

0

There are 0 answers