refactor(ui): refactor thread indicators
This commit is contained in:
@@ -926,7 +926,7 @@ class _StreamMessageWidgetState extends State<StreamMessageWidget>
|
|||||||
final showThreadTail = !(hasUrlAttachments || isGiphy || isOnlyEmoji) &&
|
final showThreadTail = !(hasUrlAttachments || isGiphy || isOnlyEmoji) &&
|
||||||
(showThreadReplyIndicator || showInChannel);
|
(showThreadReplyIndicator || showInChannel);
|
||||||
|
|
||||||
final threadIndicatorWidgets = <InlineSpan>[
|
final threadIndicatorWidgets = <WidgetSpan>[
|
||||||
if (showThreadTail)
|
if (showThreadTail)
|
||||||
WidgetSpan(
|
WidgetSpan(
|
||||||
child: Container(
|
child: Container(
|
||||||
@@ -961,12 +961,16 @@ class _StreamMessageWidgetState extends State<StreamMessageWidget>
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (widget.reverse) {
|
||||||
|
children.addAll(threadIndicatorWidgets.reversed);
|
||||||
|
} else {
|
||||||
|
children.insertAll(0, threadIndicatorWidgets);
|
||||||
|
}
|
||||||
|
|
||||||
return Text.rich(
|
return Text.rich(
|
||||||
TextSpan(
|
TextSpan(
|
||||||
children: [
|
children: [
|
||||||
if (!widget.reverse) ...threadIndicatorWidgets,
|
|
||||||
...children,
|
...children,
|
||||||
if (widget.reverse) ...threadIndicatorWidgets.reversed,
|
|
||||||
].insertBetween(const WidgetSpan(child: SizedBox(width: 8))),
|
].insertBetween(const WidgetSpan(child: SizedBox(width: 8))),
|
||||||
),
|
),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user