import 'package:hmg_patient_app/uitl/date_uitl.dart';

class YearDiabtecResultAverage {
  dynamic monthAverageResult;
  var monthNumber;
  String? monthName;
  String? yearName;
  DateTime? date;

  YearDiabtecResultAverage(
      {this.monthAverageResult,
        this.monthNumber,
        this.monthName,
        this.yearName});

  YearDiabtecResultAverage.fromJson(Map<String, dynamic> json) {
    try {
      monthAverageResult = json['monthAverageResult'];
      monthNumber = json['monthNumber'];
      monthName = json['monthName'];
      yearName = json['yearName'];
      date = DateUtil.getMonthDateTime(monthName!,yearName);
    } catch (e) {
      print(e);
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['monthAverageResult'] = this.monthAverageResult;
    data['monthNumber'] = this.monthNumber;
    data['monthName'] = this.monthName;
    data['yearName'] = this.yearName;
    return data;
  }
}
