通过发送消息进行颤振聊天显示时间

问题描述

在我的应用中,我创建了一个聊天室。这是我的messageTile。有谁知道我可以在此容器中添加其他文本吗?因为此文本应该是用户发送消息的时间。

class MessageTile extends StatelessWidget {
  final String message;
  final bool sendByMe;
  final int time;

  MessageTile({@required this.message,@required this.sendByMe,@required this.time});


  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(
          top: 3,bottom: 3,left: sendByMe ? 0 : 24,right: sendByMe ? 24 : 0),alignment: sendByMe ? Alignment.centerRight : Alignment.centerLeft,child: Container(
        margin: sendByMe
            ? EdgeInsets.only(left: 30)
            : EdgeInsets.only(right: 30),padding: EdgeInsets.only(
            top: 17,bottom: 17,left: 20,right: 20),decoration: BoxDecoration(
            borderRadius: sendByMe ? BorderRadius.only(
                topLeft: Radius.circular(9),topRight: Radius.circular(9),bottomLeft: Radius.circular(9),) :
            BorderRadius.only(
                topLeft: Radius.circular(9),bottomRight: Radius.circular(9)),color: sendByMe ? Colors.blue : Colors.white
        ),child: Text(message,textAlign: TextAlign.start,style: TextStyle(
                color: Colors.black,fontWeight: FontWeight.bold,fontFamily: 'Orbitron',fontSize: 9.0,),);
  }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)