toJson method
Implementation
@override
Map<String, dynamic> toJson() =>
// Some magic to add in the type information so the [Event] can be deserialized properly
when(
game: (g) => g.toJson()..['type'] = g.type,
general: (g) => g.toJson()..['type'] = g.type,
);