OptionResource.fromJson constructor

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

Implementation

OptionResource.fromJson(Map<String, dynamic> json)
    : this.elementIndex = json.containsKey("index") ? json["index"] : -1,
      this.rule = ifNullReturnEmpty(json['rule']),
      this.threshold = json['threshold'].toString(),
      this.notify = json['notify'] == true,
      this.alert = json['alert'] == true,
      this.text = ifNullReturnEmpty(json['text']),
      this.mapSettings = json['map_settings'].runtimeType != Null ||
              json['map_settings'] != null ||
              json['map_settings'].toString() != 'null'
          ? MapSettings.fromJson(json["map_settings"])
          : MapSettings(),
      run = json['run'].runtimeType != Null ||
              json['run'] != null ||
              json['run'].toString() != 'null'
          ? new OptionRun.fromJson(json['run'])
          : new OptionRun(),
      rounding = json['rounding'].runtimeType != Null ||
          json['rounding'] != null ||
          json['rounding'].toString() != 'null'
          ? new RoundingSettings.fromJson(json['rounding'])
          : new RoundingSettings();