updateAttachmentCancelable method

CancelableOperation<void> updateAttachmentCancelable(
  1. Attachment attachmentInfo,
  2. {required String name,
  3. required String contentType,
  4. required Uint8List data}
)

Cancelable version of updateAttachment. See that method for more information.

Implementation

CancelableOperation<void> updateAttachmentCancelable(
    Attachment attachmentInfo,
    {required String name,
    required String contentType,
    required Uint8List data}) {
  final coreName = _CString(name);
  final coreContentType = _CString(contentType);
  final coreData = data.toByteArrayWrapper();
  final taskHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_ArcGISFeature_updateAttachment(
        _handle,
        attachmentInfo._handle,
        coreName.bytes,
        coreContentType.bytes,
        coreData.ref,
        errorHandler);
  });
  return taskHandle.toCancelableOperation((_) {});
}