toJson method

dynamic toJson()

Converts this object to something serializable in JSON.

Implementation

dynamic toJson() {
  return <String, int>{
    "x": x,
    "y": y,
  };
}