im_bubble_shape.dart 456 B

123456789101112131415161718192021222324
  1. import 'package:flutter/material.dart';
  2. class ImBubbleShape extends CustomPainter {
  3. final Color bgColor;
  4. ImBubbleShape(this.bgColor);
  5. @override
  6. void paint(Canvas canvas, Size size) {
  7. var paint = Paint()..color = bgColor;
  8. var path = Path();
  9. path.lineTo(-5, 0);
  10. path.lineTo(0, 10);
  11. path.lineTo(5, 0);
  12. canvas.drawPath(path, paint);
  13. }
  14. @override
  15. bool shouldRepaint(CustomPainter oldDelegate) {
  16. return false;
  17. }
  18. }