buildMessage method

Text buildMessage(
  1. dynamic msgData
)

Implementation

Text buildMessage(dynamic msgData) { //print("New message: " + msgData.toString());
  String name = msgData[fieldOccupant]?[fieldUser]?[fieldName] ?? msgData[fieldUser]?[fieldName] ?? "";
  String nameStr = name.isEmpty ? name : "$name:";
  Color color = msgData[fieldOccupant]?[fieldChatColor] != null ?
  HexColor.fromHex(msgData[fieldOccupant]?[fieldChatColor]) : userColorMap.putIfAbsent(name, () => HexColor.rndColor(pastel: true));
  return Text("$nameStr ${msgData[fieldMsg]}", style: TextStyle(color: color));
}