toMap method Null safety

Map<String, dynamic> toMap()

Encodes TeamRating object to json map

Implementation

Map<String, dynamic> toMap() => {
      'idteam': idTeam == null ? null : idTeam,
      'idrelease': idRelease == null ? null : idRelease,
      'rating': rating == null ? null : rating,
      'rating_position': ratingPosition == null ? null : ratingPosition,
      'date': date == null
          ? null
          : "${date?.year.toString().padLeft(4, '0')}-${date?.month.toString().padLeft(2, '0')}-${date?.day.toString().padLeft(2, '0')}",
      'tech_rating': techRating == null ? null : techRating,
      'formula': formula == null ? null : formula,
    };