ConvexPainter constructor

ConvexPainter({
  1. required double top,
  2. required double width,
  3. required double height,
  4. Animation<double> leftPercent = const AlwaysStoppedAnimation<double>(0.5),
  5. TextDirection? textDirection,
  6. Color color = Colors.white,
  7. Color shadowColor = Colors.black38,
  8. double sigma = 2,
  9. Gradient? gradient,
  10. double? cornerRadius,
})

Create painter

Implementation

ConvexPainter({
  required this.top,
  required this.width,
  required this.height,
  this.leftPercent = const AlwaysStoppedAnimation<double>(0.5),
  this.textDirection,
  Color color = Colors.white,
  Color shadowColor = Colors.black38,
  double sigma = 2,
  Gradient? gradient,
  double? cornerRadius,
}) : super(repaint: leftPercent) {
  _paint.color = color;
  try {
    _shadowPaint
      ..color = shadowColor
      ..maskFilter = MaskFilter.blur(BlurStyle.outer, sigma);
  } catch (e, s) {
    debugPrintStack(label: 'ElevationError', stackTrace: s);
  }
  _gradient.gradient = gradient;
  _shape = ConvexNotchedRectangle(radius: cornerRadius ?? 0);
}