resetDb method

Future<void> resetDb()

Reset the DB by deleting and recreating it.

WARNING: This is a destructive, irrevisible action.

Implementation

Future<void> resetDb() async {
  try {
    await (await getDb()).close();

    await databaseFactory.deleteDatabase(dbName);

    // recreate
    _openDb = null;
    await getDb();
  } on FileSystemException {
    // noop
  }
}