copyExpandCanvas method

void copyExpandCanvas({
  1. int? newWidth,
  2. int? newHeight,
  3. int? padding,
  4. ExpandCanvasPosition position = ExpandCanvasPosition.center,
  5. Color? backgroundColor,
  6. Image? toImage,
})

Implementation

void copyExpandCanvas({
  int? newWidth,
  int? newHeight,
  int? padding,
  ExpandCanvasPosition position = ExpandCanvasPosition.center,
  Color? backgroundColor,
  Image? toImage,
}) {
  if ((newWidth == null || newHeight == null) && padding == null) {
    throw ArgumentError('Either new dimensions or padding must be provided');
  }
  if (newWidth != null && newHeight != null && padding != null) {
    throw ArgumentError('Cannot provide both new dimensions and padding');
  }

  subCommand = CopyExpandCanvasCmd(
    subCommand,
    newWidth: newWidth,
    newHeight: newHeight,
    padding: padding,
    position: position,
    backgroundColor: backgroundColor,
    toImage: toImage,
  );
}