fromJson static method

NotificationTypeNewPushMessage? fromJson(
  1. Map<String, dynamic>? json
)
override

Implementation

static NotificationTypeNewPushMessage? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return NotificationTypeNewPushMessage(
    messageId: (json['message_id'] as int?) ?? 0,
    senderId:
        MessageSender.fromJson(json['sender_id'] as Map<String, dynamic>?)!,
    senderName: (json['sender_name'] as String?) ?? '',
    isOutgoing: (json['is_outgoing'] as bool?) ?? false,
    content: PushMessageContent.fromJson(
        json['content'] as Map<String, dynamic>?)!,
  );
}