OverlayShape constructor

OverlayShape({
  1. Color borderColor = Colors.red,
  2. double borderWidth = 4.0,
  3. Color overlayColor = const Color.fromRGBO(0, 0, 0, 80),
  4. double borderRadius = 0,
  5. double borderLength = 42,
  6. double? cutOutSize,
  7. double? cutOutWidth,
  8. double? cutOutHeight,
  9. double cutOutBottomOffset = 0,
})

Implementation

OverlayShape({
  this.borderColor = Colors.red,
  this.borderWidth = 4.0,
  this.overlayColor = const Color.fromRGBO(0, 0, 0, 80),
  this.borderRadius = 0,
  this.borderLength = 42,
  double? cutOutSize,
  double? cutOutWidth,
  double? cutOutHeight,
  this.cutOutBottomOffset = 0,
})  : cutOutWidth = cutOutWidth ?? cutOutSize ?? 250,
      cutOutHeight = cutOutHeight ?? cutOutSize ?? 250 {
  assert(
    borderLength <=
        min(this.cutOutWidth, this.cutOutHeight) / 2 + borderWidth * 2,
    "Border can't be larger than ${min(this.cutOutWidth, this.cutOutHeight) / 2 + borderWidth * 2}",
  );
  assert(
      (cutOutWidth == null && cutOutHeight == null) ||
          (cutOutSize == 0.0 && cutOutWidth != null && cutOutHeight != null),
      'Use only cutOutWidth and cutOutHeight or only cutOutSize');
}