Merge pull request #1118 from GetStream/hotfix/messageWidget
fix(ui): fix message widget thread indicator in reverse mode
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
🐞 Fixed
|
🐞 Fixed
|
||||||
|
|
||||||
- Fixed attachment picker ui.
|
- Fixed attachment picker ui.
|
||||||
|
- Fixed message widget thread indicator in reverse mode.
|
||||||
|
|
||||||
## 4.0.1
|
## 4.0.1
|
||||||
|
|
||||||
|
|||||||
@@ -909,17 +909,6 @@ class _StreamMessageWidgetState extends State<StreamMessageWidget>
|
|||||||
const usernameKey = Key('username');
|
const usernameKey = Key('username');
|
||||||
|
|
||||||
children.addAll([
|
children.addAll([
|
||||||
if (showInChannel || showThreadReplyIndicator) ...[
|
|
||||||
if (showThreadParticipants)
|
|
||||||
SizedBox.fromSize(
|
|
||||||
size: Size((threadParticipants!.length * 8.0) + 8, 16),
|
|
||||||
child: _buildThreadParticipantsIndicator(threadParticipants),
|
|
||||||
),
|
|
||||||
InkWell(
|
|
||||||
onTap: widget.onThreadTap != null ? onThreadTap : null,
|
|
||||||
child: Text(msg, style: widget.messageTheme.repliesStyle),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
if (showUsername) _buildUsername(usernameKey),
|
if (showUsername) _buildUsername(usernameKey),
|
||||||
if (showTimeStamp)
|
if (showTimeStamp)
|
||||||
Text(
|
Text(
|
||||||
@@ -932,26 +921,41 @@ class _StreamMessageWidgetState extends State<StreamMessageWidget>
|
|||||||
final showThreadTail = !(hasUrlAttachments || isGiphy || isOnlyEmoji) &&
|
final showThreadTail = !(hasUrlAttachments || isGiphy || isOnlyEmoji) &&
|
||||||
(showThreadReplyIndicator || showInChannel);
|
(showThreadReplyIndicator || showInChannel);
|
||||||
|
|
||||||
|
final threadIndicatorWidgets = <Widget>[
|
||||||
|
if (showThreadTail)
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(
|
||||||
|
bottom: context.textScaleFactor *
|
||||||
|
((widget.messageTheme.repliesStyle?.fontSize ?? 1) / 2),
|
||||||
|
),
|
||||||
|
child: CustomPaint(
|
||||||
|
size: const Size(16, 32) * context.textScaleFactor,
|
||||||
|
painter: _ThreadReplyPainter(
|
||||||
|
context: context,
|
||||||
|
color: widget.messageTheme.messageBorderColor,
|
||||||
|
reverse: widget.reverse,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (showInChannel || showThreadReplyIndicator) ...[
|
||||||
|
if (showThreadParticipants)
|
||||||
|
SizedBox.fromSize(
|
||||||
|
size: Size((threadParticipants!.length * 8.0) + 8, 16),
|
||||||
|
child: _buildThreadParticipantsIndicator(threadParticipants),
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: widget.onThreadTap != null ? onThreadTap : null,
|
||||||
|
child: Text(msg, style: widget.messageTheme.repliesStyle),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
return Row(
|
return Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
widget.reverse ? MainAxisAlignment.end : MainAxisAlignment.start,
|
widget.reverse ? MainAxisAlignment.end : MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
if (showThreadTail && !widget.reverse)
|
if (showThreadTail && !widget.reverse) ...threadIndicatorWidgets,
|
||||||
Container(
|
|
||||||
margin: EdgeInsets.only(
|
|
||||||
bottom: context.textScaleFactor *
|
|
||||||
((widget.messageTheme.repliesStyle?.fontSize ?? 1) / 2),
|
|
||||||
),
|
|
||||||
child: CustomPaint(
|
|
||||||
size: const Size(16, 32) * context.textScaleFactor,
|
|
||||||
painter: _ThreadReplyPainter(
|
|
||||||
context: context,
|
|
||||||
color: widget.messageTheme.messageBorderColor,
|
|
||||||
reverse: widget.reverse,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
...children.map(
|
...children.map(
|
||||||
(child) {
|
(child) {
|
||||||
Widget mappedChild = SizedBox(
|
Widget mappedChild = SizedBox(
|
||||||
@@ -965,20 +969,7 @@ class _StreamMessageWidgetState extends State<StreamMessageWidget>
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
if (showThreadTail && widget.reverse)
|
if (showThreadTail && widget.reverse)
|
||||||
Container(
|
...threadIndicatorWidgets.reversed,
|
||||||
margin: EdgeInsets.only(
|
|
||||||
bottom: context.textScaleFactor *
|
|
||||||
((widget.messageTheme.repliesStyle?.fontSize ?? 1) / 2),
|
|
||||||
),
|
|
||||||
child: CustomPaint(
|
|
||||||
size: const Size(16, 32) * context.textScaleFactor,
|
|
||||||
painter: _ThreadReplyPainter(
|
|
||||||
context: context,
|
|
||||||
color: widget.messageTheme.messageBorderColor,
|
|
||||||
reverse: widget.reverse,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
].insertBetween(const SizedBox(width: 8)),
|
].insertBetween(const SizedBox(width: 8)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user