Merge pull request #14 from nosmirck/feature/message-box-user

MessageWidget now has user's name in the timestamp (like advertised design)
This commit is contained in:
Salvatore Giordano
2020-04-08 09:40:33 +02:00
committed by GitHub
+17 -6
View File
@@ -980,12 +980,23 @@ class _MessageWidgetState extends State<MessageWidget>
Widget _buildTimestamp(Alignment alignment) {
return Padding(
padding: const EdgeInsets.only(top: 5.0),
child: widget.message.createdAt != null
? Text(
Jiffy(widget.message.createdAt.toLocal()).format('HH:mm'),
style: _messageTheme.createdAt,
)
: SizedBox(),
child: RichText(
text: TextSpan(
style: _messageTheme.createdAt,
children: <TextSpan>[
if (!_isMyMessage)
TextSpan(
text: widget.message.user.name,
style: TextStyle(fontWeight: FontWeight.bold),
),
if (widget.message.createdAt != null)
TextSpan(
text:
Jiffy(widget.message.createdAt.toLocal()).format(' HH:mm'),
),
],
),
),
);
}