toJson method
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,
};
}