fromJson static method

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

Implementation

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

  return SecretChat(
    id: (json['id'] as int?) ?? 0,
    userId: (json['user_id'] as int?) ?? 0,
    state: SecretChatState.fromJson(tdMapFromJson(json['state'])),
    isOutbound: (json['is_outbound'] as bool?) ?? false,
    keyHash: (json['key_hash'] as String?) ?? '',
    layer: (json['layer'] as int?) ?? 0,
  );
}