delete method

  1. @override
Future<int> delete(
  1. T? t, [
  2. String? tableName
])
override

删除数据

Implementation

@override
Future<int> delete(T? t, [String? tableName]) {
  if (t == null) return Future.value(-1);
  Map<String, dynamic> map = t.primaryKeyAndValue();
  return db.delete(
    tableName ?? table,
    where: "${map.keys.first} = ?",
    whereArgs: [map.values.first],
  );
}