PlayerRating.fromMap constructor Null safety

PlayerRating.fromMap(
  1. Map<String, dynamic> json
)

Decodes PlayerRating object from json map

Implementation

factory PlayerRating.fromMap(Map<String, dynamic> json) => PlayerRating(
      idPlayer: json['idplayer'] == null ? null : json['idplayer'],
      idRelease: json['idrelease'] == null ? null : json['idrelease'],
      rating: json['rating'] == null ? null : json['rating'],
      ratingPosition:
          json['rating_position'] == null ? null : json['rating_position'],
      date: json['date'] == null ? null : DateTime.parse(json['date']),
      tournamentsInYear: json['tournaments_in_year'] == null
          ? null
          : json['tournaments_in_year'],
      tournamentCountTotal: json['tournament_count_total'] == null
          ? null
          : json['tournament_count_total'],
    );