From abd056841f774ffb806e76569b60701d2fa74808 Mon Sep 17 00:00:00 2001 From: sahani-deriv <125638269+sahani-deriv@users.noreply.github.com> Date: Tue, 23 Jan 2024 12:50:07 +0800 Subject: [PATCH] fix(deriv_auth): fix overflow issue in change password layout (#404) --- .../layouts/deriv_choose_new_pass_layout.dart | 100 +++++++++--------- 1 file changed, 49 insertions(+), 51 deletions(-) diff --git a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart index d254bf3c9..9b0e84b1b 100644 --- a/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart +++ b/packages/deriv_auth/lib/features/reset_password/presentation/layouts/deriv_choose_new_pass_layout.dart @@ -69,14 +69,16 @@ class _DerivChooseNewPassLayoutState extends State { child: Center( child: Form( key: _formKey, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const SizedBox(height: ThemeProvider.margin72), - _buildContent(), - const SizedBox(height: ThemeProvider.margin24), - _buildSubmitPassButton() - ], + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const SizedBox(height: ThemeProvider.margin72), + _buildContent(), + const SizedBox(height: ThemeProvider.margin24), + _buildSubmitPassButton() + ], + ), ), ), ), @@ -89,53 +91,49 @@ class _DerivChooseNewPassLayoutState extends State { return true; }, - child: SingleChildScrollView( - child: Column( - children: [ - Center( - child: SvgPicture.asset( - Assets.chooseNewPassIcon, - package: 'deriv_auth', - width: ThemeProvider.iconSize96, - height: ThemeProvider.iconSize32, - ), - ), - const SizedBox(height: ThemeProvider.margin48), - Text( - context.localization.labelChooseNewPass, - style: TextStyles.title, + child: Column( + children: [ + Center( + child: SvgPicture.asset( + Assets.chooseNewPassIcon, + package: 'deriv_auth', + width: ThemeProvider.iconSize96, + height: ThemeProvider.iconSize32, ), - const SizedBox(height: ThemeProvider.margin24), - BaseTextField( - controller: _passController, - focusNode: _passFocusNode, - labelText: context.localization.labelCreatePass, - obscureText: !_isPasswordVisible, - suffixIcon: IconButton( - icon: Icon( - _isPasswordVisible - ? Icons.visibility - : Icons.visibility_off, - color: context.theme.colors.disabled, - ), - splashColor: Colors.transparent, - highlightColor: Colors.transparent, - onPressed: () => - setState(() => _isPasswordVisible = !_isPasswordVisible), + ), + const SizedBox(height: ThemeProvider.margin48), + Text( + context.localization.labelChooseNewPass, + style: TextStyles.title, + ), + const SizedBox(height: ThemeProvider.margin24), + BaseTextField( + controller: _passController, + focusNode: _passFocusNode, + labelText: context.localization.labelCreatePass, + obscureText: !_isPasswordVisible, + suffixIcon: IconButton( + icon: Icon( + _isPasswordVisible ? Icons.visibility : Icons.visibility_off, + color: context.theme.colors.disabled, ), - validator: _passwordValidator, - onChanged: (_) => setState(() {}), - onEditingComplete: () => _formKey.currentState?.validate(), + splashColor: Colors.transparent, + highlightColor: Colors.transparent, + onPressed: () => + setState(() => _isPasswordVisible = !_isPasswordVisible), ), - const SizedBox(height: ThemeProvider.margin40), - PasswordPolicyCheckerWidget( - passwordController: _passController, - policies: PasswordPolicyCheckerWidget.getDerivPasswordPolicies( - context, - ), + validator: _passwordValidator, + onChanged: (_) => setState(() {}), + onEditingComplete: () => _formKey.currentState?.validate(), + ), + const SizedBox(height: ThemeProvider.margin40), + PasswordPolicyCheckerWidget( + passwordController: _passController, + policies: PasswordPolicyCheckerWidget.getDerivPasswordPolicies( + context, ), - ], - ), + ), + ], ), );