MessageDeliveredStatus.fromJson constructor

MessageDeliveredStatus.fromJson(
  1. Map<String, dynamic> json,
  2. String type
)

Implementation

factory MessageDeliveredStatus.fromJson(
        Map<String, dynamic> json, String type) =>
    MessageDeliveredStatus(
      deliveredCount: json["deliveredCount"],
      totalParticipatCount: json["totalParticipatCount"],
      participantList: type == "delivered"
          ? List<DeliveredParticipantList>.from(
              json["deliveredParticipantList"]
                  .map((x) => DeliveredParticipantList.fromJson(x)))
          : List<DeliveredParticipantList>.from(json["seenParticipantList"]
              .map((x) => DeliveredParticipantList.fromJson(x))),
    );