mirror of
https://bitbucket.org/myhomie/myhomie_app.git
synced 2025-12-06 17:11:19 +00:00
29 lines
1020 B
Dart
29 lines
1020 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class WaveClipper extends CustomClipper<Path> {
|
|
@override
|
|
Path getClip(Size size) {
|
|
|
|
var controlPoint1 = Offset(size.width *0.2, size.height*0.75);
|
|
var controlPoint2 = Offset(size.width *0.55, size.height*0.76);
|
|
var endPoint = Offset(size.width *0.62, size.height*0.79);
|
|
|
|
var controlPoint12 = Offset(size.width *0.82, size.height*0.85);
|
|
var controlPoint21 = Offset(size.width *0.93, size.height*1.09);
|
|
var endPoint1 = Offset(size.width, size.height*0.78);
|
|
|
|
Path path = Path()
|
|
..lineTo(0, size.height)
|
|
..cubicTo(controlPoint1.dx, controlPoint1.dy, controlPoint2.dx,
|
|
controlPoint2.dy, endPoint.dx, endPoint.dy)
|
|
..cubicTo(controlPoint12.dx, controlPoint12.dy, controlPoint21.dx,
|
|
controlPoint21.dy, endPoint1.dx, endPoint1.dy)
|
|
//..lineTo(size.width, size.height)
|
|
..lineTo(size.width, 0)
|
|
..close();
|
|
return path;
|
|
}
|
|
|
|
@override
|
|
bool shouldReclip(CustomClipper<Path> oldClipper) => false;
|
|
} |