create static method

CallState create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "callState",
  3. bool special_is_json_scheme_class = true,
  4. String special_return_type = "callState",
  5. CallStatePending? call_state_pending,
  6. CallStateExchangingKeys? call_state_exchanging_keys,
  7. CallStateReady? call_state_ready,
  8. CallStateHangingUp? call_state_hanging_up,
  9. CallStateDiscarded? call_state_discarded,
  10. CallStateError? call_state_error,
})
override

Generate By AZKADEV | Azka Axelion Gibran Script Dont edit by hand or anything manual

Implementation

static CallState create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "callState",
  bool special_is_json_scheme_class = true,
  String special_return_type = "callState",
  CallStatePending? call_state_pending,
  CallStateExchangingKeys? call_state_exchanging_keys,
  CallStateReady? call_state_ready,
  CallStateHangingUp? call_state_hanging_up,
  CallStateDiscarded? call_state_discarded,
  CallStateError? call_state_error,
}) {
  // CallState callState = CallState({
  final Map callState_data_create_json = {
    "@type": special_type,
    "@is_json_scheme_class": special_is_json_scheme_class,
    "@return_type": special_return_type,
    "call_state_pending": (call_state_pending != null) ? call_state_pending.toJson() : null,
    "call_state_exchanging_keys": (call_state_exchanging_keys != null) ? call_state_exchanging_keys.toJson() : null,
    "call_state_ready": (call_state_ready != null) ? call_state_ready.toJson() : null,
    "call_state_hanging_up": (call_state_hanging_up != null) ? call_state_hanging_up.toJson() : null,
    "call_state_discarded": (call_state_discarded != null) ? call_state_discarded.toJson() : null,
    "call_state_error": (call_state_error != null) ? call_state_error.toJson() : null,
  };

  callState_data_create_json.removeWhere((key, value) => value == null);

  if (schemeUtilsIsSetDefaultData) {
    defaultData.forEach((key, value) {
      if (callState_data_create_json.containsKey(key) == false) {
        callState_data_create_json[key] = value;
      }
    });
  }
  return CallState(callState_data_create_json);
}