Last active
October 13, 2020 00:14
-
-
Save prasadsunny1/c5e28ec10d83a2aac7581564ef83a510 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
child: CustomPaint( | |
size: Size(150,250), //You can Replace this with your desired WIDTH and HEIGHT | |
painter: RPSCustomPainter(), | |
), | |
class RPSCustomPainter extends CustomPainter{ | |
@override | |
void paint(Canvas canvas, Size size) { | |
Paint paint = new Paint() | |
..color = Colors.blue | |
..style = PaintingStyle.stroke; | |
Path path = Path(); | |
path.moveTo(size.width*0.07,size.height*0.08); | |
path.quadraticBezierTo(size.width*0.07,size.height*0.04,size.width*0.13,size.height*0.04); | |
path.cubicTo(size.width*0.32,size.height*0.04,size.width*0.68,size.height*0.04,size.width*0.87,size.height*0.04); | |
path.quadraticBezierTo(size.width*0.93,size.height*0.04,size.width*0.93,size.height*0.08); | |
path.quadraticBezierTo(size.width*0.93,size.height*0.44,size.width*0.93,size.height*0.56); | |
path.cubicTo(size.width*0.93,size.height*0.72,size.width*0.61,size.height*0.81,size.width*0.53,size.height*0.84); | |
path.quadraticBezierTo(size.width*0.49,size.height*0.85,size.width*0.46,size.height*0.84); | |
path.quadraticBezierTo(size.width*0.07,size.height*0.72,size.width*0.07,size.height*0.56); | |
path.quadraticBezierTo(size.width*0.07,size.height*0.44,size.width*0.07,size.height*0.08); | |
path.close(); | |
canvas.drawPath(path, paint); | |
} | |
@override | |
bool shouldRepaint(covariant CustomPainter oldDelegate) { | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment