fromJson static method

VacationSummary fromJson(
  1. dynamic value
)

Returns a new VacationSummary instance and imports its values from value if it's a Map, null otherwise.

Implementation

// ignore: prefer_constructors_over_static_methods
static VacationSummary fromJson(dynamic value) {
  final json = value.cast<String, dynamic>();
  return VacationSummary(
    days: VacationDay.listFromJson(json[r'days']),
    year: mapValueOfType<int>(json, r'year')!,
    scheduledDays: mapValueOfType<int>(json, r'scheduledDays')!,
    toSchedule: mapValueOfType<int>(json, r'toSchedule')!,
    holidays: Holiday.listFromJson(json[r'holidays']),
  );
}