I have a chat screen which have the chatItem box with tail end like this
Need to have that tail end in receiver side and sender side as well as I am currently using custom painter to this. And couldn't able to figure this out.
`class CustomChatBubble extends CustomPainter {CustomChatBubble({this.color, @required this.isOwn});
final Color color;
final bool isOwn;
@override
void paint(Canvas canvas, Size size) {
final paint = Paint()..color = color ?? Colors.blue;
Path paintBubbleTail() {
Path path;
if (!isOwn) {
path = Path()
..moveTo(0, size.height)
..relativeMoveTo(0,5)
..quadraticBezierTo(10, size.height , 0, size.height - 5);
}
if (isOwn) {
path = Path()
..moveTo(0, size.height)
..relativeMoveTo(0,5)
..quadraticBezierTo(10, size.height , 0, size.height - 5);
}
return path;
}
final RRect bubbleBody = RRect.fromRectAndRadius(
Rect.fromLTWH(0, 0, size.width, size.height), Radius.circular(16));
final Path bubbleTail = paintBubbleTail();
canvas.drawRRect(bubbleBody, paint);
canvas.drawPath(bubbleTail, paint);
}
@override
bool shouldRepaint(CustomPainter oldDelegate) {
// TODO: implement shouldRepaint
return true;
}
}`
This is the class I used to do isOwn is for toggle between sender and receiver