From 306994a223555d5af7d3cadfe217d718932c5eca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Salazar?= <73718835+joshrs23@users.noreply.github.com> Date: Wed, 4 Feb 2026 00:41:53 +0900 Subject: [PATCH] solving problem with taxForm --- .../src/presentation/pages/form_i9_page.dart | 22 +++++++++---------- .../src/presentation/pages/form_w4_page.dart | 8 +++---- .../presentation/pages/tax_forms_page.dart | 16 +++++++++----- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/form_i9_page.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/form_i9_page.dart index e22d97e8..fc513b7a 100644 --- a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/form_i9_page.dart +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/form_i9_page.dart @@ -159,7 +159,7 @@ class _FormI9PageState extends State { SizedBox( width: double.infinity, child: ElevatedButton( - onPressed: () => Modular.to.pop(), + onPressed: () => Modular.to.pop(true), style: ElevatedButton.styleFrom( backgroundColor: UiColors.primary, foregroundColor: UiColors.bgPopup, @@ -513,23 +513,23 @@ class _FormI9PageState extends State { _buildRadioOption( context, state, - 'citizen', + 'CITIZEN', '1. A citizen of the United States', ), const SizedBox(height: 12), _buildRadioOption( context, state, - 'noncitizen_national', + 'NONCITIZEN', '2. A noncitizen national of the United States', ), const SizedBox(height: 12), _buildRadioOption( context, state, - 'permanent_resident', + 'PERMANENT_RESIDENT', '3. A lawful permanent resident', - child: state.citizenshipStatus == 'permanent_resident' + child: state.citizenshipStatus == 'PERMANENT_RESIDENT' ? Padding( padding: const EdgeInsets.only(top: 12), child: _buildTextField( @@ -545,9 +545,9 @@ class _FormI9PageState extends State { _buildRadioOption( context, state, - 'alien_authorized', + 'ALIEN', '4. An alien authorized to work', - child: state.citizenshipStatus == 'alien_authorized' + child: state.citizenshipStatus == 'ALIEN' ? Padding( padding: const EdgeInsets.only(top: 12), child: Column( @@ -765,13 +765,13 @@ class _FormI9PageState extends State { String _getReadableCitizenship(String status) { switch (status) { - case 'citizen': + case 'CITIZEN': return 'US Citizen'; - case 'noncitizen_national': + case 'NONCITIZEN': return 'Noncitizen National'; - case 'permanent_resident': + case 'PERMANENT_RESIDENT': return 'Permanent Resident'; - case 'alien_authorized': + case 'ALIEN': return 'Alien Authorized to Work'; default: return 'Unknown'; diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/form_w4_page.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/form_w4_page.dart index 46139bb2..7d147b91 100644 --- a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/form_w4_page.dart +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/form_w4_page.dart @@ -205,7 +205,7 @@ class _FormW4PageState extends State { SizedBox( width: double.infinity, child: ElevatedButton( - onPressed: () => Modular.to.pop(), + onPressed: () => Modular.to.pop(true), style: ElevatedButton.styleFrom( backgroundColor: UiColors.primary, foregroundColor: UiColors.bgPopup, @@ -460,7 +460,7 @@ class _FormW4PageState extends State { _buildRadioOption( context, state, - 'single', + 'SINGLE', 'Single or Married filing separately', null, ), @@ -468,7 +468,7 @@ class _FormW4PageState extends State { _buildRadioOption( context, state, - 'married', + 'MARRIED', 'Married filing jointly or Qualifying surviving spouse', null, ), @@ -476,7 +476,7 @@ class _FormW4PageState extends State { _buildRadioOption( context, state, - 'head_of_household', + 'HEAD', 'Head of household', 'Check only if you\'re unmarried and pay more than half the costs of keeping up a home', ), diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/tax_forms_page.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/tax_forms_page.dart index bc241a7b..f214a99b 100644 --- a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/tax_forms_page.dart +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/tax_forms_page.dart @@ -75,7 +75,7 @@ class TaxFormsPage extends StatelessWidget { spacing: UiConstants.space6, children: [ _buildProgressOverview(state.forms), - ...state.forms.map(_buildFormCard), + ...state.forms.map((TaxForm form) => _buildFormCard(context, form)), _buildInfoCard(), ], ), @@ -138,16 +138,22 @@ class TaxFormsPage extends StatelessWidget { ); } - Widget _buildFormCard(TaxForm form) { + Widget _buildFormCard(BuildContext context, TaxForm form) { // Helper to get icon based on type (could be in entity or a mapper) final String icon = form is I9TaxForm ? '🛂' : '📋'; return GestureDetector( - onTap: () { + onTap: () async { if (form is I9TaxForm) { - Modular.to.pushNamed('i9', arguments: form); + final result = await Modular.to.pushNamed('i9', arguments: form); + if (result == true && context.mounted) { + BlocProvider.of(context).loadTaxForms(); + } } else if (form is W4TaxForm) { - Modular.to.pushNamed('w4', arguments: form); + final result = await Modular.to.pushNamed('w4', arguments: form); + if (result == true && context.mounted) { + BlocProvider.of(context).loadTaxForms(); + } } }, child: Container(