setValue method Null safety

void setValue(
  1. String key,
  2. dynamic value
)

Implementation

void setValue(String key, dynamic value) {
  try {
    KeyChild keyChild = extractKeys(key);

    if (keyChild.subKey != null) {
      this._setObjectValue(keyChild.key, keyChild.subKey, value);
    } else if (value is Map<dynamic, dynamic>) {
      this._setValue(keyChild.key, YekongaForm(values: value));
    } else {
      this._setValue(keyChild.key, value);
    }
  } catch (e) {
    print(e);
  }
}