Merge branch 'feature/new-ui' of github.com:GetStream/stream-chat-flutter into feat/messg-reply

 Conflicts:
	lib/src/message_widget.dart
This commit is contained in:
Sahil Kumar
2020-12-07 22:40:34 +05:30
5 changed files with 63 additions and 55 deletions
+16 -12
View File
@@ -198,9 +198,7 @@ class MessageWidget extends StatefulWidget {
'giphy': (context, message, attachment) {
return GiphyAttachment(
attachment: attachment,
messageTheme: messageTheme.copyWith(
messageBackgroundColor: Colors.white,
),
messageTheme: messageTheme,
message: message,
size: Size(
MediaQuery.of(context).size.width * 0.8,
@@ -515,6 +513,10 @@ class _MessageWidgetState extends State<MessageWidget> {
);
}
bool get isGiphy =>
widget.message.attachments?.any((element) => element.type == 'giphy') ==
true;
Widget _buildReadIndicator() {
var padding = 0.0;
return Stack(
@@ -708,9 +710,8 @@ class _MessageWidgetState extends State<MessageWidget> {
onTap: () => retryMessage(context),
onLongPress: () => onLongPress(context),
child: Material(
color:
attachment?.type == 'giphy' ? Colors.white : _getBackgroundColor(),
clipBehavior: Clip.hardEdge,
color: _getBackgroundColor(),
clipBehavior: Clip.antiAlias,
shape: attachmentShape,
child: Padding(
padding: widget.attachmentPadding,
@@ -861,9 +862,6 @@ class _MessageWidgetState extends State<MessageWidget> {
}
Widget _buildTextBubble(BuildContext context) {
final isOnlyEmoji =
widget.message.text.characters.every((c) => Emoji.byChar(c) != null);
Widget child = Transform(
transform: Matrix4.rotationY(widget.reverse ? pi : 0),
alignment: Alignment.center,
@@ -907,10 +905,11 @@ class _MessageWidgetState extends State<MessageWidget> {
);
}
Color _getBackgroundColor() {
final isOnlyEmoji =
widget.message.text.characters.every((c) => Emoji.byChar(c) != null);
bool get isOnlyEmoji =>
widget.message.text.characters.isNotEmpty &&
widget.message.text.characters.every((c) => Emoji.byChar(c) != null);
Color _getBackgroundColor() {
if (_hasReplyMessage) {
return widget.messageTheme.messageBackgroundColor;
}
@@ -930,6 +929,11 @@ class _MessageWidgetState extends State<MessageWidget> {
if (isOnlyEmoji) {
return Colors.transparent;
}
if (isGiphy) {
return Colors.transparent;
}
return widget.messageTheme.messageBackgroundColor;
}