delete method
Deletes records from the database table.
Optional parameters:
where: A SQL WHERE clause to specify which records to delete.whereArgs: Arguments for the WHERE clause.
Returns a Future that completes when the operation is done. Throws an error if the deletion fails.
Implementation
Future<void> delete({String? where, List<Object?>? whereArgs}) async {
try {
final db = await database;
await db.delete(_helper.tableName, where: where, whereArgs: whereArgs);
} catch (e) {
return Future.error("Error in deleting data: $e");
}
}