4

I am using the package 'sqflite' in flutter and I could not find a way to delete the entire database when the user in my app clicks on 'Delete Account'.

There are methods to delete data in a table but is there a way to delete the entire database using the package?

Vignesh Sekar
  • 76
  • 2
  • 7

1 Answers1

8

There is a delete database function in the DatabaseFactory that can delete a database based on path.

Future<void> deleteDatabase(String path) =>
    databaseFactory.deleteDatabase(path);

See documentation for more information: https://pub.dev/documentation/sqflite_common/latest/sqlite_api/DatabaseFactory-class.html

C. Molendijk
  • 2,614
  • 3
  • 26
  • 35