Skip to content

Instantly share code, notes, and snippets.

@umuieme
Created June 12, 2019 07:54
Show Gist options
  • Select an option

  • Save umuieme/cbef03a4aeb1bc16e726be18603706a2 to your computer and use it in GitHub Desktop.

Select an option

Save umuieme/cbef03a4aeb1bc16e726be18603706a2 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
class CustomRRect extends CustomClipper<Path> {
CustomRRect();
@override
Path getClip(Size size) {
var path = new Path();
path.lineTo(0.0, size.height/2 - 20);
path.quadraticBezierTo(0.0, size.height/2, 20.0, size.height/2+20);
path.lineTo(size.width - 20.0, size.height-10);
path.quadraticBezierTo(size.width, size.height, size.width, size.height - 20);
path.lineTo(size.width, 20.0);
path.quadraticBezierTo(size.width, 0, size.width - 20.0, 0);
path.lineTo(20.0, 0);
path.quadraticBezierTo(0.0, 0.0, 0.0, 20.0);
return path;
}
@override
bool shouldReclip(CustomClipper<Path> oldClipper) {
// TODO: implement shouldReclip
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment