cancel method

Future<bool> cancel()

Cancels the current task.

Implementation

Future<bool> cancel() async {
  try {
    final bool? result = await _methodChannel.invokeMethod<bool?>(
      'AGCStorageTask#$_type/cancel',
      <String, dynamic>{
        'taskId': _taskId,
      },
    );
    return result ?? false;
  } catch (e) {
    throw AGCStorageException._from(e);
  }
}