toJson method
Implementation
Map<String, dynamic> toJson() => (this is ConnectionOut)
? {
'type': 0,
'connection_id': connectionId,
'other_component_id': otherComponentId,
}
: {
'type': 1,
'connection_id': connectionId,
'other_component_id': otherComponentId,
};