change message radius
This commit is contained in:
@@ -401,7 +401,7 @@ class _MessageListViewState extends State<MessageListView> {
|
|||||||
bottomRight: Radius.circular(16),
|
bottomRight: Radius.circular(16),
|
||||||
),
|
),
|
||||||
borderSide: isMyMessage ? BorderSide.none : null,
|
borderSide: isMyMessage ? BorderSide.none : null,
|
||||||
showUserAvatar: DisplayWidget.show,
|
showUserAvatar: isMyMessage ? DisplayWidget.gone : DisplayWidget.show,
|
||||||
messageTheme: isMyMessage
|
messageTheme: isMyMessage
|
||||||
? StreamChatTheme.of(context).ownMessageTheme
|
? StreamChatTheme.of(context).ownMessageTheme
|
||||||
: StreamChatTheme.of(context).otherMessageTheme,
|
: StreamChatTheme.of(context).otherMessageTheme,
|
||||||
@@ -421,8 +421,6 @@ class _MessageListViewState extends State<MessageListView> {
|
|||||||
|
|
||||||
final userId = StreamChat.of(context).user.id;
|
final userId = StreamChat.of(context).user.id;
|
||||||
final isMyMessage = message.user.id == userId;
|
final isMyMessage = message.user.id == userId;
|
||||||
final isLastUser = index + 1 < messages.length &&
|
|
||||||
message.user.id == messages[index + 1]?.user?.id;
|
|
||||||
final isNextUser =
|
final isNextUser =
|
||||||
index - 1 >= 0 && message.user.id == messages[index - 1]?.user?.id;
|
index - 1 >= 0 && message.user.id == messages[index - 1]?.user?.id;
|
||||||
|
|
||||||
@@ -457,9 +455,10 @@ class _MessageListViewState extends State<MessageListView> {
|
|||||||
borderSide: isMyMessage ? BorderSide.none : null,
|
borderSide: isMyMessage ? BorderSide.none : null,
|
||||||
onThreadTap: _onThreadTap,
|
onThreadTap: _onThreadTap,
|
||||||
attachmentBorderRadiusGeometry: BorderRadius.circular(16),
|
attachmentBorderRadiusGeometry: BorderRadius.circular(16),
|
||||||
|
attachmentPadding: const EdgeInsets.all(2),
|
||||||
borderRadiusGeometry: BorderRadius.only(
|
borderRadiusGeometry: BorderRadius.only(
|
||||||
topLeft: Radius.circular(isLastUser ? 2 : 16),
|
topLeft: Radius.circular(16),
|
||||||
bottomLeft: Radius.circular(2),
|
bottomLeft: Radius.circular(!isNextUser ? 0 : 16),
|
||||||
topRight: Radius.circular(16),
|
topRight: Radius.circular(16),
|
||||||
bottomRight: Radius.circular(16),
|
bottomRight: Radius.circular(16),
|
||||||
),
|
),
|
||||||
|
|||||||
+28
-19
@@ -136,7 +136,10 @@ class MessageWidget extends StatefulWidget {
|
|||||||
Map<String, AttachmentBuilder> customAttachmentBuilders,
|
Map<String, AttachmentBuilder> customAttachmentBuilders,
|
||||||
this.readList,
|
this.readList,
|
||||||
this.padding,
|
this.padding,
|
||||||
this.textPadding = const EdgeInsets.all(8.0),
|
this.textPadding = const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16.0,
|
||||||
|
vertical: 8.0,
|
||||||
|
),
|
||||||
this.attachmentPadding = EdgeInsets.zero,
|
this.attachmentPadding = EdgeInsets.zero,
|
||||||
this.allRead = false,
|
this.allRead = false,
|
||||||
}) : attachmentBuilders = {
|
}) : attachmentBuilders = {
|
||||||
@@ -373,7 +376,10 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
if (widget.showUsername)
|
if (widget.showUsername)
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: widget.message.user.name,
|
text: widget.message.user.name,
|
||||||
style: TextStyle(fontWeight: FontWeight.bold),
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: widget.messageTheme.createdAt.color
|
||||||
|
.withOpacity(1)),
|
||||||
),
|
),
|
||||||
if (widget.message.createdAt != null && widget.showTimestamp)
|
if (widget.message.createdAt != null && widget.showTimestamp)
|
||||||
TextSpan(
|
TextSpan(
|
||||||
@@ -550,23 +556,26 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: widget.attachmentPadding,
|
padding: widget.attachmentPadding,
|
||||||
child: Transform(
|
child: ClipRRect(
|
||||||
transform: Matrix4.rotationY(widget.reverse ? pi : 0),
|
borderRadius: BorderRadius.circular(6),
|
||||||
alignment: Alignment.center,
|
child: Transform(
|
||||||
child: Column(
|
transform: Matrix4.rotationY(widget.reverse ? pi : 0),
|
||||||
mainAxisSize: MainAxisSize.min,
|
alignment: Alignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
child: Column(
|
||||||
children: <Widget>[
|
mainAxisSize: MainAxisSize.min,
|
||||||
getFailedMessageWidget(
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
context,
|
children: <Widget>[
|
||||||
padding: const EdgeInsets.all(8.0),
|
getFailedMessageWidget(
|
||||||
),
|
context,
|
||||||
attachmentBuilder(
|
padding: const EdgeInsets.all(8.0),
|
||||||
context,
|
),
|
||||||
widget.message,
|
attachmentBuilder(
|
||||||
attachment,
|
context,
|
||||||
),
|
widget.message,
|
||||||
],
|
attachment,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user