TournamentDetails.fromMap constructor
Decodes TournamentDetails object from json map
Implementation
factory TournamentDetails.fromMap(Map<String, dynamic> json) =>
TournamentDetails(
idTournament: json['idtournament'] == null ? -1 : json['idtournament'],
name: json['name'] == null ? null : json['name'],
town: json['town'] == null ? null : json['town'],
longName: json['long_name'] == null ? null : json['long_name'],
dateStart: json['date_start'] == null
? null
: DateTime.parse(json['date_start']),
dateEnd:
json['date_end'] == null ? null : DateTime.parse(json['date_end']),
tourCount: json['tour_count'] == null ? null : json['tour_count'],
tourQuestions:
json['tour_questions'] == null ? null : json['tour_questions'],
tourQuesPerTour: json['tour_ques_per_tour'] == null
? null
: json['tour_ques_per_tour'],
questionsTotal:
json['questions_total'] == null ? null : json['questions_total'],
typeName: json['type_name'] == null ? null : json['type_name'],
mainPaymentValue: json['main_payment_value'] == null
? null
: json['main_payment_value'],
mainPaymentCurrency: json['main_payment_currency'] == null
? null
: json['main_payment_currency'],
discountedPaymentValue: json['discounted_payment_value'] == null
? null
: json['discounted_payment_value'],
discountedPaymentCurrency: json['discounted_payment_currency'] == null
? null
: json['discounted_payment_currency'],
discountedPaymentReason: json['discounted_payment_reason'] == null
? null
: json['discounted_payment_reason'],
tournamentInRating: json['tournament_in_rating'] == null
? null
: json['tournament_in_rating'],
dateRequestsAllowedTo: json['date_requests_allowed_to'] == null
? null
: DateTime.parse(json['date_requests_allowed_to']),
comment: json['comment'] == null ? null : json['comment'],
siteUrl: json['site_url'] == null ? null : json['site_url'],
archive: json['archive'] == null ? null : json['archive'],
dateArchivedAt: json['date_archived_at'] == null
? null
: DateTime.parse(json['date_archived_at']),
dbTags: json['db_tags'] == null
? null
: List<String>.from(json['db_tags'].map((x) => x)),
);