count method

Future<int> count(
  1. ISQLiteItem item
)

Implementation

Future<int> count(ISQLiteItem item) async {
  var db = await getOpenDatabase();
  var count =
      await db.rawQuery('SELECT COUNT(*) FROM ${item.getTableName()}');
  var total = Sqflite.firstIntValue(count) ?? 0;
  return total;
}