class ShapesPainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
final Paint firstPaint = Paint();
firstPaint.color = const Color.fromARGB(255, 236, 0, 140);
final Path firstPath = Path();
firstPath.lineTo(size.width, 0);
firstPath.lineTo(0, size.height * 0.10);
firstPath.close();
canvas.drawShadow(firstPath, Colors.black87, 2.0, false);
canvas.drawPath(firstPath, firstPaint);
}
}
I need to leave margin around the screen so I am using margin in container:
........
Container(
color: Colors.white,
margin:
EdgeInsets.only(top: 60.0, bottom: 20.0, left: 15.0, right: 15.0),
child: Container(
child: CustomPaint(
painter: ShapesPainter(),
.......
I need to draw shadow under my custom path which I used anvas.drawShadow method in my build Widget, But there is a little shadow also coming over the left side, Please see the image below I pointed an error, Couldn't find any solution for this.
Thanks for any guidance.