delete method

Future<int> delete(
  1. Database db
)

Removes the request from the database and thus the queue

Implementation

Future<int> delete(Database db) async {
  final response = await findRequestInDatabase(db);

  if (response != null && response.isNotEmpty) {
    return await db.transaction((txn) async {
      return await txn.delete(
        tableName,
        where: '$primaryKeyColumn = ?',
        whereArgs: [response[primaryKeyColumn]],
      );
    });
  }

  return 0;
}