class CustomClipQuad extends CustomClipper<Path> {
@override
Path getClip(Size size) {
double w = size.width;
double h = size.height;
Path path = Path()
..lineTo(0, h)
..lineTo(w * 0.1, h)
..quadraticBezierTo(w * 0.5, h * 0.3, w - (w * 0.1), h)
..lineTo(w, h)
..lineTo(w, 0);
path.close();
return path;
}
@override
bool shouldReclip(covariant CustomClipper<Path> oldClipper) => false;
}
@override
Widget build(BuildContext context) {
final double screenHeight = MediaQuery.of(context).size.height;
return Scaffold(
appBar: AppBar(
title: const Text('Custom Clipper Path'),
),
body: ClipPath(
clipper: CustomClipQuad(),
child: Container(
alignment: Alignment.center,
color: const Color.fromARGB(255, 223, 106, 10),
width: double.maxFinite,
height: screenHeight * 0.2,
child: const Text(
'QuadraticBezier',
style: TextStyle(
color: Colors.white, fontSize: 28, fontWeight: FontWeight.bold),
),
),
),
);
}