You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.1 KiB
Dart
39 lines
1.1 KiB
Dart
4 years ago
|
import 'PointsAmountPerMonth.dart';
|
||
|
|
||
|
class PointsAmountPerYear {
|
||
|
int amountPerYear;
|
||
|
List<PointsAmountPerMonth> pointsAmountPerMonth;
|
||
|
int pointsPerYear;
|
||
|
int year;
|
||
|
|
||
|
PointsAmountPerYear(
|
||
|
{this.amountPerYear,
|
||
|
this.pointsAmountPerMonth,
|
||
|
this.pointsPerYear,
|
||
|
this.year});
|
||
|
|
||
|
PointsAmountPerYear.fromJson(Map<String, dynamic> json) {
|
||
|
amountPerYear = json['AmountPerYear'];
|
||
|
if (json['PointsAmountPerMonth'] != null) {
|
||
|
pointsAmountPerMonth = new List<PointsAmountPerMonth>();
|
||
|
json['PointsAmountPerMonth'].forEach((v) {
|
||
|
pointsAmountPerMonth.add(new PointsAmountPerMonth.fromJson(v));
|
||
|
});
|
||
|
}
|
||
|
pointsPerYear = json['PointsPerYear'];
|
||
|
year = json['Year'];
|
||
|
}
|
||
|
|
||
|
Map<String, dynamic> toJson() {
|
||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||
|
data['AmountPerYear'] = this.amountPerYear;
|
||
|
if (this.pointsAmountPerMonth != null) {
|
||
|
data['PointsAmountPerMonth'] =
|
||
|
this.pointsAmountPerMonth.map((v) => v.toJson()).toList();
|
||
|
}
|
||
|
data['PointsPerYear'] = this.pointsPerYear;
|
||
|
data['Year'] = this.year;
|
||
|
return data;
|
||
|
}
|
||
|
}
|