Object to Map serializer
@override Map<String, dynamic> toJson() { return { '@type': 'point', if (extra != null) '@extra': extra, 'x': x, 'y': y }; }