toJson method
Produces a Map that can be serialized to JSON.
Implementation
Map<String, dynamic> toJson() {
return {
if (host != null) 'host': host,
if (port != null) 'port': port,
'type': type.toString().split('.').last.toUpperCase(),
if (user != null) 'user': user,
if (pass != null) 'pass': pass,
};
}