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.

26 lines
603 B

4 years ago
import 'package:flutter/material.dart';
4 years ago
import 'package:flutter_screenutil/flutter_screenutil.dart';
4 years ago
class BackGroundClipper extends CustomClipper<Path> {
@override
Path getClip(Size size) {
//创建 Path
Path path = Path();
//移动到点 P0点 也是曲线的起点
4 years ago
path.lineTo(0, 0);
4 years ago
path.lineTo(size.width, 0);
4 years ago
path.lineTo(size.width, size.height - 30.h);
path.quadraticBezierTo(size.width / 2.0, size.height, 0, size.height - 30.h);
path.close();
4 years ago
return path;
}
@override
bool shouldReclip(CustomClipper<Path> oldClipper) {
return true;
}
}