import 'package:flutter/material.dart';

class LinePathClass extends CustomClipper<Path>{
  final double width;
  final double height;
  final String orientation;

  LinePathClass({
    required this.height,
    required this.width,
    required this.orientation
  });

  @override
  Path getClip(Size size) {
    var path = Path();
    switch(orientation){
      case 'TL':
        path.lineTo(0, size.height);
        path.lineTo(size.width, 0);
        path.lineTo(0, 0);
        return path;
        break;
      case 'BR':
        path.lineTo(0, 0);
        path.lineTo(size.width, 0);
        path.lineTo(size.height, 0);
        return path;
        break;
      case 'C':
        path.lineTo(0, 0);
        path.lineTo(size.width*0.5, size.width*0.5);
        path.lineTo(size.height, 0);
        return path;
        break;
      default:
        path.lineTo(0, height);
        path.lineTo(width, 0);
        path.lineTo(size.width-(width+height), size.height-(width+height));
        return path;
        break;
    }

  }

  @override
  bool shouldReclip(CustomClipper<Path> oldClipper) {
    return true;
  }
}