Untitled

mail@pastecode.io avatar
unknown
dart
2 years ago
1.5 kB
4
Indexable
class ProviderIncome {
  List<Months>? months;

  ProviderIncome({this.months});

  ProviderIncome.fromJson(Map<String, dynamic> json) {
    if (json['Months'] != null) {
      months = <Months>[];
      json['Months'].forEach((v) {
        months!.add(new Months.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.months != null) {
      data['Months'] = this.months!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Months {
  int? month;
  List<Week>? week;
  double? sum;

  Months({this.month, this.week, this.sum});

  Months.fromJson(Map<String, dynamic> json) {
    month = json['month'];
    if (json['week'] != null) {
      week = <Week>[];
      json['week'].forEach((v) {
        week!.add(new Week.fromJson(v));
      });
    }
    sum = json['sum'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['month'] = this.month;
    if (this.week != null) {
      data['week'] = this.week!.map((v) => v.toJson()).toList();
    }
    data['sum'] = this.sum;
    return data;
  }
}

class Week {
  int? week;
  double? sum;

  Week({this.week, this.sum});

  Week.fromJson(Map<String, dynamic> json) {
    week = json['week'];
    sum = json['sum'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['week'] = this.week;
    data['sum'] = this.sum;
    return data;
  }
}