tableExists method

Future<bool> tableExists({
  1. required String tableName,
})

Implementation

Future<bool> tableExists({required String tableName}) async {
  final db = await database;
  final result = await db.rawQuery(
    "SELECT name FROM sqlite_master WHERE type='table' AND name=?",
    [tableName],
  );
  return result.isNotEmpty;
}