clearTable method

Future<void> clearTable(
  1. String tableName
)

删除所有数据

Implementation

Future<void> clearTable(String tableName) async {
  try {
    await _database!.execute("delete from $tableName");
    //reset the auto increase id
    await _database!.execute("update sqlite_sequence SET seq = 0 where name ='$tableName';");
  } catch (e) {
    print(e);
  }
}