toJson method

  1. @override
Map<String, Object?> toJson()

Converts this object to json representation.

Implementation

@override
Map<String, Object?> toJson() {
  return <String, Object?>{
    InsanichessGameEventJsonKey.type: type.toJson(),
    InsanichessGameEventJsonKey.movePlayed: move.toICString(),
    if (timeSpent != null)
      InsanichessGameEventJsonKey.timeSpent: timeSpent!.inMilliseconds,
    if (player != null) InsanichessGameEventJsonKey.color: player!.toJson(),
  };
}