import 'PointsAmountPerday.dart'; class PointsAmountPerMonth { double amountPerMonth; String month; int monthNumber; List pointsAmountPerday; double pointsPerMonth; PointsAmountPerMonth( {this.amountPerMonth, this.month, this.monthNumber, this.pointsAmountPerday, this.pointsPerMonth}); PointsAmountPerMonth.fromJson(Map json) { amountPerMonth = json['AmountPerMonth']; month = json['Month']; monthNumber = json['MonthNumber']; if (json['PointsAmountPerday'] != null) { pointsAmountPerday = new List(); json['PointsAmountPerday'].forEach((v) { pointsAmountPerday.add(new PointsAmountPerday.fromJson(v)); }); } pointsPerMonth = json['PointsPerMonth']; } Map toJson() { final Map data = new Map(); data['AmountPerMonth'] = this.amountPerMonth; data['Month'] = this.month; data['MonthNumber'] = this.monthNumber; if (this.pointsAmountPerday != null) { data['PointsAmountPerday'] = this.pointsAmountPerday.map((v) => v.toJson()).toList(); } data['PointsPerMonth'] = this.pointsPerMonth; return data; } }