buildMessage method
Text
buildMessage(
- 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));
}