buildListItemView method

Widget buildListItemView(
  1. int index,
  2. Message item
)

Implementation

Widget buildListItemView(int index, Message item){
  bool isMe = item.fromMe;
  return Wrap(
    alignment: isMe ? WrapAlignment.end : WrapAlignment.start,
    children: <Widget>[
      Card(
          shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(5),),
          margin: EdgeInsets.fromLTRB(isMe ? 20 : 10, 5, isMe ? 10 : 20, 5),
          color: isMe ? Color(0xffEFFFDE) : Colors.white, elevation: 1,
          child : Padding(
            padding: EdgeInsets.symmetric(horizontal: 5, vertical: 5),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.end,
              children: <Widget>[
                Container(
                  constraints: BoxConstraints(minWidth: 150),
                  child: Text(item.content, style: MyText.subhead(context)!.copyWith(
                      color: Colors.black)
                  ),
                ),
                Container(height: 3, width: 0),
                Row(
                  crossAxisAlignment: CrossAxisAlignment.center,
                  mainAxisSize: MainAxisSize.min,
                  children: <Widget>[
                    Text(item.date, textAlign: TextAlign.end, style: TextStyle(fontSize: 12, color: isMe ? Color(0xff58B346) : MyColors.grey_40)),
                    Container(width: 3),
                    isMe ? Icon(Icons.done_all, size: 12, color: Color(0xff58B346)) : Container(width: 0, height: 0)
                  ],
                )
              ],
            ),
          )
      )
    ],
  );
}