Item.fromJson constructor

Item.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Item.fromJson(Map<String, dynamic> json) {
  return Item(
    absoluteTime: json['AbsoluteTime'] as String?,
    attachments: (json['Attachments'] as List?)
        ?.whereNotNull()
        .map((e) => AttachmentItem.fromJson(e as Map<String, dynamic>))
        .toList(),
    content: json['Content'] as String?,
    contentType: json['ContentType'] as String?,
    displayName: json['DisplayName'] as String?,
    id: json['Id'] as String?,
    participantId: json['ParticipantId'] as String?,
    participantRole:
        (json['ParticipantRole'] as String?)?.toParticipantRole(),
    type: (json['Type'] as String?)?.toChatItemType(),
  );
}