Closed ubaid-shamsi closed 1 month ago
Describe the bug { "type": "column", "args": { "crossAxisAlignment": "start", "children": [ { "type": "set_value", "args": { "values": { "switchBoxKey": "clause", "totalSwitchBoxCount": 8 } } }, { "type": "set_default_value", "args": { "values": { "isAny_checked": false } } }, { "type": "dg_text", "id": "your_tax_residency_status", "args": { "text": "Your Tax & Residency Status", "style": "titleLarge" } }, { "type": "sized_box", "args": { "height": 24 } }, { "type": "container", "args": { "decoration": { "border": { "color": "#CECFCF", "width": 1 }, "shape": "rectangle", "borderRadius": 12 }, "child": { "type": "padding", "args": { "padding": [ 18, 18 ], "child": { "type": "form", "args": { "child": { "type": "column", "args": { "crossAxisAlignment": "start", "children": [ { "type": "dg_switch", "id": "clause1", "listen": [ "clause1" ], "args": { "prefixText": "None of these apply to me", "label": "Tax and Residency Switch 1", "onChanged": "${taxResidency_switch_onChanged('clause1','switchBoxKey','totalSwitchBoxCount')}", "value": "${clause1 ?? false}" } }, { "type": "dg_switch", "id": "clause2", "listen": [ "clause2" ], "args": { "prefixText": "Are you a Tax Resident of any country other than Pakistan and \nUnited States of America (USA)?", "label": "Tax and Residency Switch 2", "onChanged": "${taxResidency_switch_onChanged('clause2','switchBoxKey','totalSwitchBoxCount')}", "value": "${clause2 ?? false}" } }, { "type": "dg_switch", "id": "clause3", "listen": [ "clause3" ], "args": { "prefixText": "Are you a US National, Citizen, Green Card holder or resident?", "label": "Tax and Residency Switch 3", "onChanged": "${taxResidency_switch_onChanged('clause3','switchBoxKey','totalSwitchBoxCount')}", "value": "${clause3 ?? false}" } }, { "type": "dg_switch", "id": "clause4", "listen": [ "clause4" ], "args": { "prefixText": "Is your country of birth US?", "label": "Tax and Residency Switch 4", "onChanged": "${taxResidency_switch_onChanged('clause4','switchBoxKey','totalSwitchBoxCount')}", "value": "${clause4 ?? false}" } }, { "type": "dg_switch", "id": "clause5", "listen": [ "clause5" ], "args": { "prefixText": "Do you have US address or Telephone number?", "label": "Tax and Residency Switch 5", "onChanged": "${taxResidency_switch_onChanged('clause5','switchBoxKey','totalSwitchBoxCount')}", "value": "${clause5 ?? false}" } }, { "type": "dg_switch", "id": "clause6", "listen": [ "clause6" ], "args": { "prefixText": "Have you assigned a mandate to a person having an address in the US?", "label": "Tax and Residency Switch 6", "onChanged": "${taxResidency_switch_onChanged('clause6','switchBoxKey','totalSwitchBoxCount')}", "value": "${clause6 ?? false}" } }, { "type": "dg_switch", "id": "clause7", "listen": [ "clause7" ], "args": { "prefixText": "Are you aware of any other information that may indicate US links?", "label": "Tax and Residency Switch 7", "onChanged": "${taxResidency_switch_onChanged('clause7','switchBoxKey','totalSwitchBoxCount')}", "value": "${clause7 ?? false}" } }, { "type": "dg_switch", "id": "clause8", "listen": [ "clause8" ], "args": { "prefixText": "Are you, or any of your relatives, a politically exposed person (i.e. Heads of State, senior military, bureaucratic or judicial officials, individuals with political affiliations etc.)?", "label": "Tax and Residency Switch 8", "onChanged": "${taxResidency_switch_onChanged('clause8','switchBoxKey','totalSwitchBoxCount')}", "value": "${clause8 ?? false}" } } ] } } } } } } } }, { "type": "sized_box", "args": { "height": 15 } }, { "type": "dg_spacer" }, { "type": "container", "args": { "alignment": "center", "width": "infinity", "child": { "type": "save_context", "args": { "key": "form_context_4", "child": { "type": "dg_main_button", "id": "continue_switch_button", "listen": [ "isAny_checked", "switchBoxKey", "totalSwitchBoxCount" ], "args": { "text": "Continue", "onPressed": "${(isAny_checked ?? false)? submitFormWithoutValidation('form_context_4') : null}" } } } } } } ] } }, I have this widget when I renders the widget and trying to get the values on toggle on changed those values that I have set before using set_value & set_default value its always getting null. But when I go back once and then come again to this screen using default back navigation its start working.
Describe the bug { "type": "column", "args": { "crossAxisAlignment": "start", "children": [ { "type": "set_value", "args": { "values": { "switchBoxKey": "clause", "totalSwitchBoxCount": 8 } } }, { "type": "set_default_value", "args": { "values": { "isAny_checked": false } } }, { "type": "dg_text", "id": "your_tax_residency_status", "args": { "text": "Your Tax & Residency Status", "style": "titleLarge" } }, { "type": "sized_box", "args": { "height": 24 } }, { "type": "container", "args": { "decoration": { "border": { "color": "#CECFCF", "width": 1 }, "shape": "rectangle", "borderRadius": 12 }, "child": { "type": "padding", "args": { "padding": [ 18, 18 ], "child": { "type": "form", "args": { "child": { "type": "column", "args": { "crossAxisAlignment": "start", "children": [ { "type": "dg_switch", "id": "clause1", "listen": [ "clause1" ], "args": { "prefixText": "None of these apply to me", "label": "Tax and Residency Switch 1", "onChanged": "${taxResidency_switch_onChanged('clause1','switchBoxKey','totalSwitchBoxCount')}", "value": "${clause1 ?? false}" } }, { "type": "dg_switch", "id": "clause2", "listen": [ "clause2" ], "args": { "prefixText": "Are you a Tax Resident of any country other than Pakistan and \nUnited States of America (USA)?", "label": "Tax and Residency Switch 2", "onChanged": "${taxResidency_switch_onChanged('clause2','switchBoxKey','totalSwitchBoxCount')}", "value": "${clause2 ?? false}" } }, { "type": "dg_switch", "id": "clause3", "listen": [ "clause3" ], "args": { "prefixText": "Are you a US National, Citizen, Green Card holder or resident?", "label": "Tax and Residency Switch 3", "onChanged": "${taxResidency_switch_onChanged('clause3','switchBoxKey','totalSwitchBoxCount')}", "value": "${clause3 ?? false}" } }, { "type": "dg_switch", "id": "clause4", "listen": [ "clause4" ], "args": { "prefixText": "Is your country of birth US?", "label": "Tax and Residency Switch 4", "onChanged": "${taxResidency_switch_onChanged('clause4','switchBoxKey','totalSwitchBoxCount')}", "value": "${clause4 ?? false}" } }, { "type": "dg_switch", "id": "clause5", "listen": [ "clause5" ], "args": { "prefixText": "Do you have US address or Telephone number?", "label": "Tax and Residency Switch 5", "onChanged": "${taxResidency_switch_onChanged('clause5','switchBoxKey','totalSwitchBoxCount')}", "value": "${clause5 ?? false}" } }, { "type": "dg_switch", "id": "clause6", "listen": [ "clause6" ], "args": { "prefixText": "Have you assigned a mandate to a person having an address in the US?", "label": "Tax and Residency Switch 6", "onChanged": "${taxResidency_switch_onChanged('clause6','switchBoxKey','totalSwitchBoxCount')}", "value": "${clause6 ?? false}" } }, { "type": "dg_switch", "id": "clause7", "listen": [ "clause7" ], "args": { "prefixText": "Are you aware of any other information that may indicate US links?", "label": "Tax and Residency Switch 7", "onChanged": "${taxResidency_switch_onChanged('clause7','switchBoxKey','totalSwitchBoxCount')}", "value": "${clause7 ?? false}" } }, { "type": "dg_switch", "id": "clause8", "listen": [ "clause8" ], "args": { "prefixText": "Are you, or any of your relatives, a politically exposed person (i.e. Heads of State, senior military, bureaucratic or judicial officials, individuals with political affiliations etc.)?", "label": "Tax and Residency Switch 8", "onChanged": "${taxResidency_switch_onChanged('clause8','switchBoxKey','totalSwitchBoxCount')}", "value": "${clause8 ?? false}" } } ] } } } } } } } }, { "type": "sized_box", "args": { "height": 15 } }, { "type": "dg_spacer" }, { "type": "container", "args": { "alignment": "center", "width": "infinity", "child": { "type": "save_context", "args": { "key": "form_context_4", "child": { "type": "dg_main_button", "id": "continue_switch_button", "listen": [ "isAny_checked", "switchBoxKey", "totalSwitchBoxCount" ], "args": { "text": "Continue", "onPressed": "${(isAny_checked ?? false)? submitFormWithoutValidation('form_context_4') : null}" } } } } } } ] } }, I have this widget when I renders the widget and trying to get the values on toggle on changed those values that I have set before using set_value & set_default value its always getting null. But when I go back once and then come again to this screen using default back navigation its start working.