Hide timeStamp and sendingIndicator for a threaded reply message

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2020-12-23 15:30:41 +05:30
parent 7efb6ca3dd
commit bb49084952
+22 -16
View File
@@ -428,23 +428,11 @@ class _MessageWidgetState extends State<MessageWidget> {
], ],
), ),
); );
} else { } else if (showInChannel) {
final showSendingIndicator =
widget.showSendingIndicator == DisplayWidget.show;
final replyCount = widget.message.replyCount;
final msg = showInChannel
? 'Thread Reply'
: replyCount != 0
? '$replyCount ${replyCount > 1 ? 'Thread Replies' : 'Thread Reply'}'
: 'Thread Reply';
final onThreadTap = () async { final onThreadTap = () async {
try { try {
var message = widget.message; final channel = StreamChannel.of(context);
if (showInChannel && message.parentId != null) { final message = await channel.getMessage(widget.message.parentId);
final channel = StreamChannel.of(context);
message = await channel.getMessage(widget.message.parentId);
}
return widget.onThreadTap(message); return widget.onThreadTap(message);
} catch (e, stk) { } catch (e, stk) {
print(e); print(e);
@@ -452,6 +440,24 @@ class _MessageWidgetState extends State<MessageWidget> {
return null; return null;
} }
}; };
children.add(
InkWell(
onTap: widget.onThreadTap != null ? onThreadTap : null,
child: Text('Thread Reply', style: widget.messageTheme?.replies),
),
);
} else {
final showSendingIndicator =
widget.showSendingIndicator == DisplayWidget.show;
final replyCount = widget.message.replyCount;
final msg = replyCount != 0
? '$replyCount ${replyCount > 1 ? 'Thread Replies' : 'Thread Reply'}'
: 'Thread Reply';
final onThreadTap = () async {
var message = widget.message;
return widget.onThreadTap(message);
};
children.addAll([ children.addAll([
if (showSendingIndicator) _buildSendingIndicator(), if (showSendingIndicator) _buildSendingIndicator(),
@@ -463,7 +469,7 @@ class _MessageWidgetState extends State<MessageWidget> {
child: _buildReadIndicator(), child: _buildReadIndicator(),
), ),
), ),
if (showThreadReplyIndicator || showInChannel) if (showThreadReplyIndicator)
InkWell( InkWell(
onTap: widget.onThreadTap != null ? onThreadTap : null, onTap: widget.onThreadTap != null ? onThreadTap : null,
child: Text(msg, style: widget.messageTheme?.replies), child: Text(msg, style: widget.messageTheme?.replies),