-
I have a log out/account deletion feature in my app, and I want to delete the app's database when that happens. |
Beta Was this translation helpful? Give feedback.
Answered by
simolus3
May 24, 2024
Replies: 1 comment 1 reply
-
So the easiest way is to just close the database instance and then delete the database If it's easier to keep the database open, you can delete content from all tables like this: await transaction(() async {
for (final table in allTables) {
await delete(table).go();
}
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
triallax
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So the easiest way is to just close the database instance and then delete the database
File
that you're passing toNativeDatabase
.If it's easier to keep the database open, you can delete content from all tables like this: