ChatRoomData constructor
ChatRoomData(
- String type,
- dynamic data
Implementation
ChatRoomData(this.type, data) {
switch (type) {
case ChatRoomMessageType.online:
online = data;
break;
case ChatRoomMessageType.discussChanged:
discuss = data;
break;
case ChatRoomMessageType.revoke:
revoke = data;
break;
case ChatRoomMessageType.music:
case ChatRoomMessageType.weather:
case ChatRoomMessageType.redPacket:
case ChatRoomMessageType.msg:
msg = data;
break;
case ChatRoomMessageType.redPacketStatus:
status = data;
break;
case ChatRoomMessageType.barrager:
barrager = data;
break;
case ChatRoomMessageType.custom:
custom = data;
break;
default:
unknown = data;
break;
}
}