fromJson static method

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

Implementation

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

  return GroupCallParticipant(
    participantId: MessageSender.fromJson(
      tdMapFromJson(json['participant_id']),
    ),
    audioSourceId: (json['audio_source_id'] as int?) ?? 0,
    screenSharingAudioSourceId:
        (json['screen_sharing_audio_source_id'] as int?) ?? 0,
    videoInfo: GroupCallParticipantVideoInfo.fromJson(
      tdMapFromJson(json['video_info']),
    ),
    screenSharingVideoInfo: GroupCallParticipantVideoInfo.fromJson(
      tdMapFromJson(json['screen_sharing_video_info']),
    ),
    bio: (json['bio'] as String?) ?? '',
    isCurrentUser: (json['is_current_user'] as bool?) ?? false,
    isSpeaking: (json['is_speaking'] as bool?) ?? false,
    isHandRaised: (json['is_hand_raised'] as bool?) ?? false,
    canBeMutedForAllUsers:
        (json['can_be_muted_for_all_users'] as bool?) ?? false,
    canBeUnmutedForAllUsers:
        (json['can_be_unmuted_for_all_users'] as bool?) ?? false,
    canBeMutedForCurrentUser:
        (json['can_be_muted_for_current_user'] as bool?) ?? false,
    canBeUnmutedForCurrentUser:
        (json['can_be_unmuted_for_current_user'] as bool?) ?? false,
    isMutedForAllUsers: (json['is_muted_for_all_users'] as bool?) ?? false,
    isMutedForCurrentUser:
        (json['is_muted_for_current_user'] as bool?) ?? false,
    canUnmuteSelf: (json['can_unmute_self'] as bool?) ?? false,
    volumeLevel: (json['volume_level'] as int?) ?? 0,
    order: (json['order'] as String?) ?? '',
  );
}