feat(chat): bubbles

This commit is contained in:
mso7nueh
2024-06-13 17:28:53 +03:00
parent 46d374d87e
commit b52251a9d1
53 changed files with 2331 additions and 481 deletions

View File

@@ -0,0 +1,37 @@
import 'package:flutter/material.dart';
class ChatBubbleWidget extends StatelessWidget {
const ChatBubbleWidget({
super.key,
required this.text,
required this.isCurrentUser,
});
final String text;
final bool isCurrentUser;
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.fromLTRB(isCurrentUser ? 64 : 16, 4, isCurrentUser ? 16 : 64, 4),
child: Align(
alignment: isCurrentUser ? Alignment.centerRight : Alignment.centerLeft,
child: DecoratedBox(
decoration: BoxDecoration(
color: isCurrentUser ? Colors.blue : Colors.grey[300],
borderRadius: BorderRadius.circular(16),
),
child: Padding(
padding: const EdgeInsets.all(12),
child: Text(
text,
style: TextStyle(
color: isCurrentUser ? Colors.white : Colors.black87,
),
),
),
),
),
);
}
}