LabelPainter constructor

LabelPainter({
  1. double opacity = 1,
  2. bool hasArrow = false,
  3. bool hasLabelBox = false,
  4. ArrowPosition arrowPosition = ArrowPosition.top,
  5. double arrowHeight = kArrowHeight,
  6. EdgeInsets labelBoxPadding = const EdgeInsets.all(8.0),
  7. BoxDecoration labelBoxDecoration = const BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.all(Radius.circular(8.0)), color: transparentColor),
  8. required Rect hole,
  9. required bool isTop,
})

Implementation

LabelPainter({
  this.opacity = 1,
  this.hasArrow = false,
  this.hasLabelBox = false,
  this.arrowPosition = ArrowPosition.top,
  this.arrowHeight = kArrowHeight,
  this.labelBoxPadding = const EdgeInsets.all(8.0),
  this.labelBoxDecoration = const BoxDecoration(
    shape: BoxShape.rectangle,
    borderRadius: BorderRadius.all(Radius.circular(8.0)),
    color: transparentColor,
  ),
  required this.hole,
  required this.isTop,
})  : assert(
          (hasArrow && hasLabelBox) ||
              (!hasArrow && !hasLabelBox) ||
              !hasArrow && hasLabelBox,
          'hasArrow $hasArrow cannot be true if hasLabelBox $hasLabelBox is false'),
      _decoration = labelBoxDecoration.copyWith(
        shape: BoxShape.rectangle,
      );