DateQuestion.fromJson constructor

DateQuestion.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory fromJson(Map<String, dynamic> json) {
  final dateFormatPreset = json['dateFormatPreset'] as String?;
  if (!json.containsKey('inputType') && dateFormatPreset != null) {
    json['inputType'] =
        const {
          'isoDateTime',
          'europeanDateTime',
          'usDateTimeAmPm',
        }.contains(dateFormatPreset)
        ? 'dateTime'
        : 'date';
  }
  return _$DateQuestionFromJson(json);
}