import 'package:flutter/material.dart';
import 'package:freekake/components/navbar_shape_2.dart';

class CustomShape extends StatelessWidget {
  const CustomShape({super.key});

  @override
  Widget build(BuildContext context) {
    var screen = MediaQuery.of(context).size;
    return Positioned(
      child: Container(
        width: screen.width,
        height: screen.height,
        color: const Color.fromARGB(255, 38, 139, 92),
        child: CustomPaint(child: CustomPaint(painter: RPSCustomPainter())),
      ),
    );
  }
}

class RPSCustomPainter extends CustomPainter {
  @override
  void paint(Canvas canvas, Size size) {
    // Layer 1

    Paint paint_fill_0 =
        Paint()
          ..color = const Color.fromARGB(255, 189, 18, 18)
          ..style = PaintingStyle.fill
          ..strokeWidth = size.width * 0.00
          ..strokeCap = StrokeCap.butt
          ..strokeJoin = StrokeJoin.miter;

    Path path_0 = Path();
    path_0.moveTo(size.width * 0.8040007, size.height * 0.1994400);
    path_0.cubicTo(
      size.width * 0.3471602,
      size.height * 0.1989000,
      size.width * 0.3471602,
      size.height * 0.1989000,
      size.width * 0.1948800,
      size.height * 0.1987200,
    );
    path_0.cubicTo(
      size.width * 0.1333300,
      size.height * 0.2084400,
      size.width * 0.1371800,
      size.height * 0.3968400,
      size.width * 0.1964501,
      size.height * 0.4014400,
    );
    path_0.cubicTo(
      size.width * 0.3483083,
      size.height * 0.4004200,
      size.width * 0.6520247,
      size.height * 0.3983800,
      size.width * 0.8038829,
      size.height * 0.3973600,
    );
    path_0.cubicTo(
      size.width * 0.8621500,
      size.height * 0.3952400,
      size.width * 0.8608700,
      size.height * 0.2083600,
      size.width * 0.8040007,
      size.height * 0.1994400,
    );
    path_0.close();

    canvas.drawPath(path_0, paint_fill_0);

    // Layer 1

    Paint paint_stroke_0 =
        Paint()
          ..color = const Color.fromARGB(255, 33, 150, 243)
          ..style = PaintingStyle.stroke
          ..strokeWidth = size.width * 0.00
          ..strokeCap = StrokeCap.butt
          ..strokeJoin = StrokeJoin.miter;

    canvas.drawPath(path_0, paint_stroke_0);

    // Layer 1

    Paint paint_fill_1 =
        Paint()
          ..color = const Color.fromARGB(255, 28, 163, 52)
          ..style = PaintingStyle.fill
          ..strokeWidth = size.width * 0.00
          ..strokeCap = StrokeCap.butt
          ..strokeJoin = StrokeJoin.miter;

    Path path_1 = Path();
    path_1.moveTo(size.width * 0.4000300, size.height * 0.1987400);
    path_1.lineTo(size.width * 0.6010900, size.height * 0.2005400);
    path_1.quadraticBezierTo(
      size.width * 0.5764200,
      size.height * 0.1947400,
      size.width * 0.5721900,
      size.height * 0.1545000,
    );
    path_1.cubicTo(
      size.width * 0.5500300,
      size.height * 0.0020000,
      size.width * 0.4492300,
      size.height * 0.0042400,
      size.width * 0.4271600,
      size.height * 0.1487400,
    );
    path_1.quadraticBezierTo(
      size.width * 0.4232300,
      size.height * 0.1963200,
      size.width * 0.4000300,
      size.height * 0.1987400,
    );
    path_1.close();

    canvas.drawPath(path_1, paint_fill_1);

    // Layer 1

    Paint paint_stroke_1 =
        Paint()
          ..color = const Color.fromARGB(255, 33, 150, 243)
          ..style = PaintingStyle.stroke
          ..strokeWidth = size.width * 0.00
          ..strokeCap = StrokeCap.butt
          ..strokeJoin = StrokeJoin.miter;

    canvas.drawPath(path_1, paint_stroke_1);

    // layer 2
    // Paint paint_fill_0 =
    //     Paint()
    //       ..color = const Color.fromARGB(255, 28, 163, 52)
    //       ..style = PaintingStyle.fill
    //       ..strokeWidth = size.width * 0.00
    //       ..strokeCap = StrokeCap.butt
    //       ..strokeJoin = StrokeJoin.miter;

    // Path path_0 = Path();
    path_0.moveTo(size.width * 0.4000300, size.height * 0.1987400);
    path_0.lineTo(size.width * 0.6010900, size.height * 0.2005400);
    path_0.quadraticBezierTo(
      size.width * 0.5764200,
      size.height * 0.1947400,
      size.width * 0.5721900,
      size.height * 0.1545000,
    );
    path_0.cubicTo(
      size.width * 0.5500300,
      size.height * 0.0020000,
      size.width * 0.4492300,
      size.height * 0.0042400,
      size.width * 0.4271600,
      size.height * 0.1487400,
    );
    path_0.quadraticBezierTo(
      size.width * 0.4232300,
      size.height * 0.1963200,
      size.width * 0.4000300,
      size.height * 0.1987400,
    );
    path_0.close();

    canvas.drawPath(path_0, paint_fill_0);

    // Layer 1

    // Paint paint_stroke_0 =
    //     Paint()
    //       ..color = const Color.fromARGB(255, 33, 150, 243)
    //       ..style = PaintingStyle.stroke
    //       ..strokeWidth = size.width * 0.00
    //       ..strokeCap = StrokeCap.butt
    //       ..strokeJoin = StrokeJoin.miter;

    // canvas.drawPath(path_0, paint_stroke_0);
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) {
    return true;
  }
}
