import 'PointsDetails.dart'; class PointsAmountPerday { num amountPerDay; String day; List pointsDetails; num pointsPerDay; String transationDate; PointsAmountPerday( {this.amountPerDay, this.day, this.pointsDetails, this.pointsPerDay, this.transationDate}); PointsAmountPerday.fromJson(Map json) { amountPerDay = json['AmountPerDay']; day = json['Day']; if (json['PointsDetails'] != null) { pointsDetails = new List(); json['PointsDetails'].forEach((v) { pointsDetails.add(new PointsDetails.fromJson(v)); }); } pointsPerDay = json['PointsPerDay']; transationDate = json['TransationDate']; } Map toJson() { final Map data = new Map(); data['AmountPerDay'] = this.amountPerDay; data['Day'] = this.day; if (this.pointsDetails != null) { data['PointsDetails'] = this.pointsDetails.map((v) => v.toJson()).toList(); } data['PointsPerDay'] = this.pointsPerDay; data['TransationDate'] = this.transationDate; return data; } }