toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
  json[r'name'] = this.name;
  json[r'code'] = this.code;
  json[r'description'] = this.description;
  json[r'points'] = this.points;
  json[r'type'] = this.type;
  if (this.target != null) {
    json[r'target'] = this.target;
  } else {
    json[r'target'] = null;
  }
  json[r'total'] = this.total;
  json[r'rewards'] = this.rewards;
  json[r'current'] = this.current;
  if (this.completedAt != null) {
    json[r'completed_at'] = this.completedAt!.toUtc().toIso8601String();
  } else {
    json[r'completed_at'] = null;
  }
  return json;
}