import 'dart:developer';

import 'package:hmg_patient_app_new/core/utils/date_util.dart';

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

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

  YearDiabeticResultAverage.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) {
      log(e.toString());
    }
  }

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

