fromJson static method

Game<Event> fromJson(
  1. Map<String, dynamic> json
)

Converts the game from json to the particular type based on the type field

Implementation

static Game fromJson(Map<String, dynamic> json) {
  final fromJson = _fromJsonFactory[json['type']];
  if (fromJson == null) {
    throw UnimplementedError('No game of that type exists ${json['type']}');
  }
  return fromJson(json);
}