ConvexPainter constructor
ConvexPainter({
- required double top,
- required double width,
- required double height,
- required NotchSmoothness notchSmoothness,
- Animation<
double> leftPercent = const AlwaysStoppedAnimation<double>(0.5), - TextDirection? textDirection,
- Color color = Colors.white,
- Color shadowColor = const Color.fromRGBO(0, 0, 0, 0.06),
- double sigma = 2,
- Gradient? gradient,
- bool isHexagon = false,
- bool outside = false,
- bool drawHexagon = false,
- bool convexBridge = false,
- double leftCornerRadius = 0,
- 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,
);
}