cancelTask static method

Future<void> cancelTask(
  1. String taskId
)

Cancels a scheduled background task by taskId.

Example:

await BloomBackground.cancelTask('syncTasks');

Implementation

static Future<void> cancelTask(String taskId) async {
  logger.debug('BloomBackground: Cancelling background task "$taskId"');
  try {
    await _channel.invokeMethod('cancelTask', {'taskId': taskId});
  } catch (e) {
    logger.warn('BloomBackground: Cancel task note: $e');
  }
}