CropImage constructor

CropImage({
  1. Key? key,
  2. required Image image,
  3. int? width,
  4. int? height,
  5. int srcX = 0,
  6. int srcY = 0,
  7. int? srcWidth,
  8. int? srcHeight,
})

Implementation

CropImage({
  Key? key,
  required this.image,
  int? width,
  int? height,
  int srcX = 0,
  int srcY = 0,
  int? srcWidth,
  int? srcHeight,
})  : assert((srcWidth ?? 0) >= 0),
      assert((srcHeight ?? 0) >= 0),
      src = ui.Rect.fromLTWH(
        srcX.toDouble(),
        srcY.toDouble(),
        (srcWidth ?? image.width).toDouble(),
        (srcHeight ?? image.height).toDouble(),
      ),
      dst = ui.Rect.fromLTWH(
        0,
        0,
        (width ?? image.width).toDouble(),
        (height ?? image.height).toDouble(),
      ),
      super(key: key);