pauseDownload method

GemError pauseDownload({
  1. void onComplete(
    1. GemError
    )?,
})

Pause a previous download operation.

User will receive a notification on the asyncDownload's onComplete callback with a GemError.suspended error.

Parameters

  • IN onComplete Object that implements notification event associated with operation completion. Returns GemError.success on success, otherwise GemError.general.

Returns

Throws

  • An exception if it fails.

Implementation

GemError pauseDownload({void Function(GemError)? onComplete}) {
  final OperationResult resultString = objectMethod(
    _pointerId,
    'ContentStoreItem',
    'pauseDownload',
  );

  final err = GemErrorExtension.fromCode(resultString['result']);

  if (err == GemError.success && onComplete != null) {
    _tryNotifyComplete(onComplete: onComplete);
  }

  if (err != GemError.success) {
    onComplete?.call(err);
  }

  return err;
}