WhyConfig.fromJson constructor

WhyConfig.fromJson(
  1. dynamic json, {
  2. dynamic attendedValueOfQuestion,
})

Implementation

WhyConfig.fromJson(dynamic json, {dynamic attendedValueOfQuestion}) {
  var defaultConf = WhyConfig();

  if (json == true) {
    label = json['label'] ?? defaultConf.label;
    placeholder = json['placeholder'] ?? defaultConf.placeholder;
    isMandatory = json['isMandatory'] ?? defaultConf.isMandatory;
    attendedValue = json['attendedValue'] ?? attendedValueOfQuestion;
    return;
  }

  if (json is Map<String, dynamic>) {
    label = json['label'] ?? defaultConf.label;
    placeholder = json['placeholder'] ?? defaultConf.placeholder;
    isMandatory = json['isMandatory'] ?? defaultConf.isMandatory;
    attendedValue = json['attendedValue'] ?? attendedValueOfQuestion;
    return;
  }

  label = defaultConf.label;
  placeholder = defaultConf.placeholder;
  isMandatory = defaultConf.isMandatory;
  attendedValue = attendedValueOfQuestion;
}