added user's name to message box
This commit is contained in:
@@ -980,12 +980,23 @@ class _MessageWidgetState extends State<MessageWidget>
|
|||||||
Widget _buildTimestamp(Alignment alignment) {
|
Widget _buildTimestamp(Alignment alignment) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(top: 5.0),
|
padding: const EdgeInsets.only(top: 5.0),
|
||||||
child: widget.message.createdAt != null
|
child: RichText(
|
||||||
? Text(
|
text: TextSpan(
|
||||||
Jiffy(widget.message.createdAt.toLocal()).format('HH:mm'),
|
style: _messageTheme.createdAt,
|
||||||
style: _messageTheme.createdAt,
|
children: <TextSpan>[
|
||||||
)
|
if (!_isMyMessage)
|
||||||
: SizedBox(),
|
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'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user