addAttachmentCancelable method

CancelableOperation<Attachment> addAttachmentCancelable(
  1. {required String name,
  2. required String contentType,
  3. required Uint8List data}
)

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

Implementation

CancelableOperation<Attachment> addAttachmentCancelable(
    {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_addAttachment(_handle, coreName.bytes,
        coreContentType.bytes, coreData.ref, errorHandler);
  });
  return taskHandle
      .toCancelableOperation((element) => element.getValueAsAttachment()!);
}