toJson method

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

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,
    );