Skip to content

Instantly share code, notes, and snippets.

@MarcinusX MarcinusX/ticket_card.dart Secret
Created Sep 3, 2018

What would you like to do?
class TicketCard extends StatelessWidget {
Widget build(BuildContext context) {
return ClipPath(
clipper: TicketClipper(10.0),
child: Material(
elevation: 4.0,
shadowColor: Color(0x30E5E5E5),
color: Colors.transparent,
child: ClipPath(
clipper: TicketClipper(12.0),
child: Card(
elevation: 0.0,
margin: const EdgeInsets.all(2.0),
child: _buildCardContent(),
class TicketClipper extends CustomClipper<Path> {
final double radius;
Path getClip(Size size) {
var path = new Path();
path.lineTo(0.0, size.height);
path.lineTo(size.width, size.height);
path.lineTo(size.width, 0.0);
Rect.fromCircle(center: Offset(0.0, size.height / 2), radius: radius));
Rect.fromCircle(center: Offset(size.width, size.height / 2), radius: radius));
return path;
bool shouldReclip(CustomClipper<Path> oldClipper) => true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.