You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

31 lines
967 B

import 'package:flutter/material.dart';
class CurvePainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
// final Shader linearGradient = LinearGradient(
// colors: <Color>[Color(0xffDA44bb), Color(0xff8921aa)],
// ).createShader(Rect.fromLTWH(0.0, 0.0, 200.0, 70.0));
// var paint = Paint()..shader = linearGradient
var paint = Paint();
paint.color = Colors.white;
paint.style = PaintingStyle.fill; // Change this to fill
var path = Path();
path.moveTo(0.2, size.height * 0.55);
path.quadraticBezierTo(size.width * 0.4, size.height * 0.8,
size.width * 0.75, size.height * 0.40);
path.quadraticBezierTo(size.width * 0.85, size.height * 0.30,
size.width * 1.0, size.height * 0.3468);
path.lineTo(size.width, size.height);
path.lineTo(0, size.height);
canvas.drawPath(path, paint);
}
@override
bool shouldRepaint(CustomPainter oldDelegate) {
return true;
}
}