factory DateRange.fromJson(Map<String, dynamic> json) { return DateRange( unit: (json['Unit'] as String?)?.toDateRangeUnit(), value: json['Value'] as int?, ); }