createSwatchCancelable method

CancelableOperation<ArcGISImage> createSwatchCancelable(
  1. {required double screenScale,
  2. Size? size,
  3. Color backgroundColor = Colors.transparent}
)

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

Implementation

CancelableOperation<ArcGISImage> createSwatchCancelable(
    {required double screenScale,
    Size? size,
    Color backgroundColor = Colors.transparent}) {
  final coreBackgroundColor = backgroundColor.toArcGIS();
  final taskHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_Symbol_createSwatchCombined(_handle, screenScale,
        size, coreBackgroundColor._handle, errorHandler);
  });
  return taskHandle
      .toCancelableOperation((element) => element.getValueAsArcGISImage()!);
}