ConvexPainter constructor

ConvexPainter({
  1. required double top,
  2. required double width,
  3. required double height,
  4. required NotchSmoothness notchSmoothness,
  5. Animation<double> leftPercent = const AlwaysStoppedAnimation<double>(0.5),
  6. TextDirection? textDirection,
  7. Color color = Colors.white,
  8. Color shadowColor = const Color.fromRGBO(0, 0, 0, 0.06),
  9. double sigma = 2,
  10. Gradient? gradient,
  11. bool isHexagon = false,
  12. bool outside = false,
  13. bool drawHexagon = false,
  14. bool convexBridge = false,
  15. double leftCornerRadius = 0,
  16. double rightCornerRadius = 0,
})

Create painter

Implementation

ConvexPainter({
  required this.top,
  required this.width,
  required this.height,
  required this.notchSmoothness,
  this.leftPercent = const AlwaysStoppedAnimation<double>(0.5),
  this.textDirection,
  Color color = Colors.white,
  Color shadowColor = const Color.fromRGBO(0, 0, 0, 0.06),
  double sigma = 2,
  Gradient? gradient,
  this.isHexagon = false,
  this.outside = false,
  this.drawHexagon = false,
  this.convexBridge = false,
  this.leftCornerRadius = 0,
  this.rightCornerRadius = 0,
}) : super(repaint: leftPercent) {
  _paint.color = color;
  try {
    _shadowPaint
      ..color = shadowColor
      ..maskFilter = MaskFilter.blur(BlurStyle.outer, sigma);
  } catch (e, s) {
    debugPrintStack(label: 'ElevationError', stackTrace: s);
  }
  _shape = ConvexNotchedRectangle(
    isHexagon: isHexagon,
    drawHexagon: drawHexagon,
    notchSmoothness: notchSmoothness,
    convexBridge: convexBridge,
    leftCornerRadius: leftCornerRadius,
    rightCornerRadius: rightCornerRadius,
  );
}