JMReceiveTransCommandEvent.fromJson constructor

JMReceiveTransCommandEvent.fromJson(
  1. Map json
)

Implementation

JMReceiveTransCommandEvent.fromJson(Map<dynamic, dynamic> json)
    :receiverType = getEnumFromString(JMTargetType.values, json['receiverType']),
      message = json['message'],
      sender = JMUserInfo.fromJson(json['sender']) {
        switch (receiverType) {
          case JMTargetType.user:
              receiver = JMUserInfo.fromJson(json['receiver']);
            break;
          case JMTargetType.group:
            receiver = JMGroupInfo.fromJson(json['receiver']);
            break;
  }
}