fromJson method
Converts a JSON map to a PortShape object.
Uses the factory constructor PortShape.fromJson to create the appropriate subclass based on the 'type' field in the JSON.
Implementation
@override
PortShape fromJson(Map<String, dynamic> json) {
return PortShape.fromJson(json);
}