Skip to content

Instantly share code, notes, and snippets.

@kspo
Created November 16, 2023 01:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kspo/7601bb52058b0100017da08b46f27d12 to your computer and use it in GitHub Desktop.
Save kspo/7601bb52058b0100017da08b46f27d12 to your computer and use it in GitHub Desktop.
Arrow Shape
import 'package:flutter/cupertino.dart';
class ArrowPaint extends CustomPainter {
final Color color;
ArrowPaint({required this.color});
@override
void paint(Canvas canvas, Size size) {
Path path_0 = Path();
path_0.moveTo(size.width * 0.5745375, size.height * 0.06573708);
path_0.lineTo(size.width * 0.9813667, size.height * 0.8794000);
path_0.cubicTo(
size.width * 1.001950,
size.height * 0.9205625,
size.width * 0.9852625,
size.height * 0.9706208,
size.width * 0.9441000,
size.height * 0.9912000);
path_0.cubicTo(
size.width * 0.9325250,
size.height * 0.9969875,
size.width * 0.9197667,
size.height,
size.width * 0.9068292,
size.height);
path_0.lineTo(size.width * 0.09316958, size.height);
path_0.cubicTo(
size.width * 0.04714583,
size.height,
size.width * 0.009836208,
size.height * 0.9626917,
size.width * 0.009836208,
size.height * 0.9166667);
path_0.cubicTo(
size.width * 0.009836208,
size.height * 0.9037292,
size.width * 0.01284829,
size.height * 0.8909708,
size.width * 0.01863392,
size.height * 0.8794000);
path_0.lineTo(size.width * 0.4254625, size.height * 0.06573708);
path_0.cubicTo(
size.width * 0.4460458,
size.height * 0.02457225,
size.width * 0.4961042,
size.height * 0.007886875,
size.width * 0.5372667,
size.height * 0.02846929);
path_0.cubicTo(
size.width * 0.5533958,
size.height * 0.03653296,
size.width * 0.5664708,
size.height * 0.04961000,
size.width * 0.5745375,
size.height * 0.06573708);
path_0.close();
Paint paint_0_fill = Paint()..style = PaintingStyle.fill;
paint_0_fill.color = color;
canvas.drawPath(path_0, paint_0_fill);
}
@override
bool shouldRepaint(covariant CustomPainter oldDelegate) {
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment