Map<String, dynamic> toJson() { final ip = this.ip; final port = this.port; return { 'Ip': ip, if (port != null) 'Port': port, }; }