Allows you to serialize object.
Map<String, dynamic> toJson() { Map<String, dynamic> result = {}; result["x"] = x; result["y"] = y; return result; }