OtherOptionConfig.fromJson constructor

OtherOptionConfig.fromJson(
  1. dynamic json
)

Implementation

OtherOptionConfig.fromJson(dynamic json) {
  var defaultConf = OtherOptionConfig();

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

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

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