mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 00:21:19 +00:00
63 lines
1.8 KiB
Dart
63 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class WaveClipper extends CustomClipper<Path> {
|
|
bool minimized;
|
|
double height;
|
|
double width;
|
|
double move = 0;
|
|
|
|
WaveClipper({
|
|
this.move,
|
|
this.minimized,
|
|
this.height,
|
|
this.width,
|
|
}) : super();
|
|
|
|
@override
|
|
Path getClip(Size size) {
|
|
|
|
/*print('height from parent = ' + this.height.toString());
|
|
print('width from parent = ' + this.width.toString());
|
|
print('bool from parent = ' + this.minimized.toString());*/
|
|
|
|
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.width)
|
|
..lineTo(size.width, size.height)
|
|
..lineTo(size.width, 0)
|
|
..close();*/
|
|
Path path = Path()
|
|
..lineTo(0, size.width)
|
|
..lineTo(size.width, size.height)
|
|
..lineTo(size.width*move, 0)
|
|
..close();
|
|
|
|
//print("move is = " + move.toString());
|
|
|
|
/*Path path = Path()
|
|
..moveTo(0, size.height*0.3 *move)
|
|
..cubicTo(0, size.height*0.3, 0, 0, size.width*0.4, 0)
|
|
..lineTo(size.width*0.4, 0)
|
|
..lineTo(size.height, size.width)
|
|
/*..cubicTo(controlPoint1.dx, controlPoint1.dy, controlPoint2.dx * move,
|
|
controlPoint2.dy, endPoint.dx, endPoint.dy)
|
|
..cubicTo(controlPoint12.dx* move, controlPoint12.dy, controlPoint21.dx,
|
|
controlPoint21.dy, endPoint1.dx, endPoint1.dy * move)*/
|
|
//..lineTo(size.width, size.height)
|
|
|
|
..close();*/
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
@override
|
|
bool shouldReclip(CustomClipper<Path> oldClipper) => true;
|
|
} |