diff --git a/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/pages/bank_account_page.dart b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/pages/bank_account_page.dart index 6d8bffae..431355e7 100644 --- a/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/pages/bank_account_page.dart +++ b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/pages/bank_account_page.dart @@ -72,43 +72,50 @@ class BankAccountPage extends StatelessWidget { const SizedBox(height: UiConstants.space3), ...state.accounts.map((BankAccount a) => _buildAccountCard(a, strings)), // Added type - if (state.showForm) ...[ - const SizedBox(height: UiConstants.space6), - AddAccountForm( - strings: strings, - onSubmit: (String routing, String account, String type) { // Added types - cubit.addAccount( - routingNumber: routing, - accountNumber: account, - type: type); - }, - onCancel: () { - cubit.toggleForm(false); - } - ), - ], // Add extra padding at bottom const SizedBox(height: 80), ], ), ), ), - if (!state.showForm) - Container( - padding: const EdgeInsets.all(UiConstants.space5), - decoration: const BoxDecoration( - color: UiColors.background, // Was surface - border: Border(top: BorderSide(color: UiColors.border)), - ), - child: SafeArea( - child: UiButton.primary( - text: strings.add_account, - leadingIcon: UiIcons.add, - onPressed: () => cubit.toggleForm(true), - fullWidth: true, - ), + Container( + padding: const EdgeInsets.all(UiConstants.space5), + decoration: const BoxDecoration( + color: UiColors.background, // Was surface + border: Border(top: BorderSide(color: UiColors.border)), + ), + child: SafeArea( + child: UiButton.primary( + text: strings.add_account, + leadingIcon: UiIcons.add, + onPressed: () { + showDialog( + context: context, + builder: (BuildContext context) { + return Dialog( + backgroundColor: Colors.transparent, + child: AddAccountForm( + strings: strings, + onSubmit: (String routing, String account, String type) { + cubit.addAccount( + routingNumber: routing, + accountNumber: account, + type: type, + ); + Modular.to.popPage(); + }, + onCancel: () { + Modular.to.popPage(); + }, + ), + ); + }, + ); + }, + fullWidth: true, ), ), + ), ], ); }, diff --git a/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/widgets/add_account_form.dart b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/widgets/add_account_form.dart index 47d41d63..6b07b661 100644 --- a/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/widgets/add_account_form.dart +++ b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/widgets/add_account_form.dart @@ -37,6 +37,7 @@ class _AddAccountFormState extends State { ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, children: [ Text( widget.strings.add_new_account,