toJson method

Map<String, dynamic> toJson()

Serializes a GameHighScore object to a JSON map Returns a Map<String, dynamic> containing the serialized object

Implementation

Map<String, dynamic> toJson() {
  return {
    'position': position,
    'user': user.toJson(),
    'score': score,
  };
}