From 9f96232ea01477f1483eb66ca2da184f17b89c57 Mon Sep 17 00:00:00 2001 From: ice-ajax <190340101+ice-ajax@users.noreply.github.com> Date: Thu, 2 Jan 2025 08:05:10 +0100 Subject: [PATCH] fix: improve 2fa delete input step padding --- .../delete_authenticator_input_step.dart | 1 + .../components/delete_twofa_input_step.dart | 61 ++++++++++--------- .../delete_twofa_step_scaffold.dart | 4 +- 3 files changed, 36 insertions(+), 30 deletions(-) diff --git a/lib/app/features/protect_account/authenticator/views/pages/delete_authenticator/components/delete_authenticator_input_step.dart b/lib/app/features/protect_account/authenticator/views/pages/delete_authenticator/components/delete_authenticator_input_step.dart index f99ba96f1..202d1aef3 100644 --- a/lib/app/features/protect_account/authenticator/views/pages/delete_authenticator/components/delete_authenticator_input_step.dart +++ b/lib/app/features/protect_account/authenticator/views/pages/delete_authenticator/components/delete_authenticator_input_step.dart @@ -21,6 +21,7 @@ class DeleteAuthenticatorInputStep extends ConsumerWidget { headerTitle: locale.authenticator_delete_title, headerDescription: locale.authenticator_delete_description, headerIcon: Assets.svg.iconWalletProtectFill.icon(size: 36.0.s), + contentPadding: 8.0.s, child: DeleteTwoFAInputStep( twoFaToDelete: TwoFaType.auth, onDeleteSuccess: () => AuthenticatorDeleteSuccessRoute().push(context), diff --git a/lib/app/features/protect_account/components/delete_twofa_input_step.dart b/lib/app/features/protect_account/components/delete_twofa_input_step.dart index 89e3e79cc..b122ee2ba 100644 --- a/lib/app/features/protect_account/components/delete_twofa_input_step.dart +++ b/lib/app/features/protect_account/components/delete_twofa_input_step.dart @@ -51,35 +51,38 @@ class DeleteTwoFAInputStep extends HookConsumerWidget { key: formKey.value, child: CustomScrollView( slivers: [ - SliverList.builder( - itemCount: twoFaTypes.length, - itemBuilder: (context, index) { - final twoFaType = twoFaTypes[index]; - return Padding( - padding: EdgeInsets.only(bottom: 22.0.s), - child: TwoFaCodeInput( - controller: controllers[twoFaType]!, - twoFaType: twoFaType, - onRequestCode: () async { - await guardPasskeyDialog( - ref.context, - (child) => RiverpodVerifyIdentityRequestBuilder( - provider: requestTwoFaCodeNotifierProvider, - requestWithVerifyIdentity: - (OnVerifyIdentity onVerifyIdentity) { - ref.read(requestTwoFaCodeNotifierProvider.notifier).requestTwoFaCode( - twoFaType, - onVerifyIdentity, - ); - }, - child: child, - ), - ); - }, - isSending: isRequesting, - ), - ); - }, + SliverPadding( + padding: EdgeInsets.only(top: 56.0.s), + sliver: SliverList.builder( + itemCount: twoFaTypes.length, + itemBuilder: (context, index) { + final twoFaType = twoFaTypes[index]; + return Padding( + padding: EdgeInsets.only(bottom: 22.0.s), + child: TwoFaCodeInput( + controller: controllers[twoFaType]!, + twoFaType: twoFaType, + onRequestCode: () async { + await guardPasskeyDialog( + ref.context, + (child) => RiverpodVerifyIdentityRequestBuilder( + provider: requestTwoFaCodeNotifierProvider, + requestWithVerifyIdentity: + (OnVerifyIdentity onVerifyIdentity) { + ref.read(requestTwoFaCodeNotifierProvider.notifier).requestTwoFaCode( + twoFaType, + onVerifyIdentity, + ); + }, + child: child, + ), + ); + }, + isSending: isRequesting, + ), + ); + }, + ), ), SliverFillRemaining( hasScrollBody: false, diff --git a/lib/app/features/protect_account/components/delete_twofa_step_scaffold.dart b/lib/app/features/protect_account/components/delete_twofa_step_scaffold.dart index f85e96be8..490038a4d 100644 --- a/lib/app/features/protect_account/components/delete_twofa_step_scaffold.dart +++ b/lib/app/features/protect_account/components/delete_twofa_step_scaffold.dart @@ -15,6 +15,7 @@ class DeleteTwoFAStepScaffold extends ConsumerWidget { required this.headerDescription, required this.headerIcon, required this.child, + this.contentPadding, super.key, }); @@ -22,6 +23,7 @@ class DeleteTwoFAStepScaffold extends ConsumerWidget { final String headerDescription; final Widget headerIcon; final Widget child; + final double? contentPadding; @override Widget build(BuildContext context, WidgetRef ref) { @@ -46,7 +48,7 @@ class DeleteTwoFAStepScaffold extends ConsumerWidget { description: headerDescription, icon: AuthHeaderIcon(icon: headerIcon), ), - SizedBox(height: 64.0.s), + SizedBox(height: contentPadding ?? 64.0.s), Expanded(child: child), ], ),