getAnswerValueToStore function
dynamic
getAnswerValueToStore(
- dynamic value,
- dynamic otherInput,
- dynamic otherInputText,
- dynamic otherInputId,
- dynamic isPhoneInput,
- dynamic phoneValue,
Implementation
getAnswerValueToStore(
value, otherInput, otherInputText, otherInputId, isPhoneInput, phoneValue) {
if (otherInput == false && isPhoneInput == false) {
return value;
}
if (isPhoneInput == true) {
return phoneValue;
}
if (otherInput == true) {
var newValue = [...value];
var otherInputIndex = newValue.indexOf(otherInputId);
newValue[otherInputIndex] = {
'id': otherInputId,
'other_txt': otherInputText
};
return newValue;
}
}