createSwatchWithGeometryCancelable method

CancelableOperation<ArcGISImage> createSwatchWithGeometryCancelable(
  1. {required double screenScale,
  2. required Size size,
  3. required Geometry geometry,
  4. Color backgroundColor = Colors.transparent}
)

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

Implementation

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