mirrored_repositories/DTubeGo/lib/ui/pages/user
import 'package:flutter/material.dart';
import 'package:responsive_sizer/responsive_sizer.dart';

class TopBarCustomClipper extends CustomClipper<Path> {
  @override
  Path getClip(Size size) {
    // This variable define for better understanding you can direct specify value in quadraticBezierTo method
    var controlPoint = Offset(size.width / 2, size.height / 2);
    var endPoint = Offset(size.width, size.height);

    Path ovalPath = Path();
    ovalPath.moveTo(0, 0);
    ovalPath.quadraticBezierTo(0, 0, 0.w, 14.h);
    ovalPath.quadraticBezierTo(0, 25.h, 17.w, 25.h);
    ovalPath.quadraticBezierTo(125.w, 25.h, 125.w, 25.h);
    ovalPath.quadraticBezierTo(125.w, 0, 125.w, 0);
    // ovalPath.lineTo(0, height);

    ovalPath.close();

    return ovalPath;
  }
//     final height = size.height;
//     final width = size.width;
//     Paint paint = Paint();

//     Path mainBackground = Path();
//     // mainBackground.addRect(Rect.fromLTRB(0, 0, 10, 10));
//     paint.color = Colors.blue.shade700;
//     canvas.drawPath(mainBackground, paint);

//     Path ovalPath = Path();
//     // Start paint from 20% height to the left
//     // ovalPath.moveTo(0, height * 0.2);
//     ovalPath.moveTo(0, 0);
// // paint a curve from current position to middle of the screen
//     ovalPath.quadraticBezierTo(0, 0, 0.w, 15.h);
//     // paint a curve from current position to middle of the screen
//     ovalPath.quadraticBezierTo(0, 25.h, 15.w, 25.h);
//     ovalPath.quadraticBezierTo(125.w, 25.h, 125.w, 25.h);
//     ovalPath.quadraticBezierTo(125.w, 0, 125.w, 0);

//     ovalPath.lineTo(0, height);

//     ovalPath.close();

//     paint.color = Colors.blue.shade600;
//     canvas.drawPath(ovalPath, paint);
  //}

  @override
  bool shouldReclip(CustomClipper<Path> oldClipper) => false;
}
