самое главное, чтобы углы были закруглены.

Вот мой текущий код:
CustomPaint(
size: const Size(20, 61),
painter: TrianglePainter(color: appColor.fade(0.08)),
child: Padding(
padding: const EdgeInsets.only(left: 9, right: 16, top: 7, bottom: 7),
child: Text(
"28 book summaries a month",
style: const TextStyle(fontSize: 12.5, color: appColor, fontWeight: FontWeight.w500),
),
),
),
class TrianglePainter extends CustomPainter {
final Color color;
TrianglePainter({required this.color});
@override
void paint(Canvas canvas, Size size) {
final paint = Paint()
..color = color
..style = PaintingStyle.fill;
final path = Path();
final w = size.width;
final h = size.height;
path.moveTo(0, 0);
path.lineTo(w - (w * 0.2), 0);
path.lineTo(w, h / 2);
path.lineTo(w - (w * 0.2), h);
path.lineTo(0, h);
path.close();
canvas.drawPath(path, paint);
}
@override
bool shouldRepaint(covariant CustomPainter oldDelegate) => false;
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... om-painter
Мобильная версия