solving problem with taxForm

This commit is contained in:
José Salazar
2026-02-04 00:41:53 +09:00
parent 470749501b
commit 306994a223
3 changed files with 26 additions and 20 deletions

View File

@@ -159,7 +159,7 @@ class _FormI9PageState extends State<FormI9Page> {
SizedBox( SizedBox(
width: double.infinity, width: double.infinity,
child: ElevatedButton( child: ElevatedButton(
onPressed: () => Modular.to.pop(), onPressed: () => Modular.to.pop(true),
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: UiColors.primary, backgroundColor: UiColors.primary,
foregroundColor: UiColors.bgPopup, foregroundColor: UiColors.bgPopup,
@@ -513,23 +513,23 @@ class _FormI9PageState extends State<FormI9Page> {
_buildRadioOption( _buildRadioOption(
context, context,
state, state,
'citizen', 'CITIZEN',
'1. A citizen of the United States', '1. A citizen of the United States',
), ),
const SizedBox(height: 12), const SizedBox(height: 12),
_buildRadioOption( _buildRadioOption(
context, context,
state, state,
'noncitizen_national', 'NONCITIZEN',
'2. A noncitizen national of the United States', '2. A noncitizen national of the United States',
), ),
const SizedBox(height: 12), const SizedBox(height: 12),
_buildRadioOption( _buildRadioOption(
context, context,
state, state,
'permanent_resident', 'PERMANENT_RESIDENT',
'3. A lawful permanent resident', '3. A lawful permanent resident',
child: state.citizenshipStatus == 'permanent_resident' child: state.citizenshipStatus == 'PERMANENT_RESIDENT'
? Padding( ? Padding(
padding: const EdgeInsets.only(top: 12), padding: const EdgeInsets.only(top: 12),
child: _buildTextField( child: _buildTextField(
@@ -545,9 +545,9 @@ class _FormI9PageState extends State<FormI9Page> {
_buildRadioOption( _buildRadioOption(
context, context,
state, state,
'alien_authorized', 'ALIEN',
'4. An alien authorized to work', '4. An alien authorized to work',
child: state.citizenshipStatus == 'alien_authorized' child: state.citizenshipStatus == 'ALIEN'
? Padding( ? Padding(
padding: const EdgeInsets.only(top: 12), padding: const EdgeInsets.only(top: 12),
child: Column( child: Column(
@@ -765,13 +765,13 @@ class _FormI9PageState extends State<FormI9Page> {
String _getReadableCitizenship(String status) { String _getReadableCitizenship(String status) {
switch (status) { switch (status) {
case 'citizen': case 'CITIZEN':
return 'US Citizen'; return 'US Citizen';
case 'noncitizen_national': case 'NONCITIZEN':
return 'Noncitizen National'; return 'Noncitizen National';
case 'permanent_resident': case 'PERMANENT_RESIDENT':
return 'Permanent Resident'; return 'Permanent Resident';
case 'alien_authorized': case 'ALIEN':
return 'Alien Authorized to Work'; return 'Alien Authorized to Work';
default: default:
return 'Unknown'; return 'Unknown';

View File

@@ -205,7 +205,7 @@ class _FormW4PageState extends State<FormW4Page> {
SizedBox( SizedBox(
width: double.infinity, width: double.infinity,
child: ElevatedButton( child: ElevatedButton(
onPressed: () => Modular.to.pop(), onPressed: () => Modular.to.pop(true),
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: UiColors.primary, backgroundColor: UiColors.primary,
foregroundColor: UiColors.bgPopup, foregroundColor: UiColors.bgPopup,
@@ -460,7 +460,7 @@ class _FormW4PageState extends State<FormW4Page> {
_buildRadioOption( _buildRadioOption(
context, context,
state, state,
'single', 'SINGLE',
'Single or Married filing separately', 'Single or Married filing separately',
null, null,
), ),
@@ -468,7 +468,7 @@ class _FormW4PageState extends State<FormW4Page> {
_buildRadioOption( _buildRadioOption(
context, context,
state, state,
'married', 'MARRIED',
'Married filing jointly or Qualifying surviving spouse', 'Married filing jointly or Qualifying surviving spouse',
null, null,
), ),
@@ -476,7 +476,7 @@ class _FormW4PageState extends State<FormW4Page> {
_buildRadioOption( _buildRadioOption(
context, context,
state, state,
'head_of_household', 'HEAD',
'Head of household', 'Head of household',
'Check only if you\'re unmarried and pay more than half the costs of keeping up a home', 'Check only if you\'re unmarried and pay more than half the costs of keeping up a home',
), ),

View File

@@ -75,7 +75,7 @@ class TaxFormsPage extends StatelessWidget {
spacing: UiConstants.space6, spacing: UiConstants.space6,
children: <Widget>[ children: <Widget>[
_buildProgressOverview(state.forms), _buildProgressOverview(state.forms),
...state.forms.map(_buildFormCard), ...state.forms.map((TaxForm form) => _buildFormCard(context, form)),
_buildInfoCard(), _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) // Helper to get icon based on type (could be in entity or a mapper)
final String icon = form is I9TaxForm ? '🛂' : '📋'; final String icon = form is I9TaxForm ? '🛂' : '📋';
return GestureDetector( return GestureDetector(
onTap: () { onTap: () async {
if (form is I9TaxForm) { 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<TaxFormsCubit>(context).loadTaxForms();
}
} else if (form is W4TaxForm) { } 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<TaxFormsCubit>(context).loadTaxForms();
}
} }
}, },
child: Container( child: Container(