deleteTask method

  1. @override
Future<bool> deleteTask(
  1. String taskId
)
override

Deletes a task from the queue and cleans up associated resources. Returns true if the task was successfully deleted, false if the task wasn't found.

Parameters:

  • taskId: The ID of the task to delete

Implementation

@override
Future<bool> deleteTask(String taskId) async {
  try {
    return await _channel.invokeMethod('deleteTask', {
          'task_id': taskId,
        }) ??
        false;
  } on PlatformException catch (e) {
    throw Exception("Failed to delete task: ${e.message}");
  }
}