Skip to content

Commit

Permalink
fix(deriv_auth): fix overflow issue in change password layout (#404)
Browse files Browse the repository at this point in the history
  • Loading branch information
sahani-deriv authored Jan 23, 2024
1 parent 2f268b4 commit abd0568
Showing 1 changed file with 49 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,16 @@ class _DerivChooseNewPassLayoutState extends State<DerivChooseNewPassLayout> {
child: Center(
child: Form(
key: _formKey,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const SizedBox(height: ThemeProvider.margin72),
_buildContent(),
const SizedBox(height: ThemeProvider.margin24),
_buildSubmitPassButton()
],
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const SizedBox(height: ThemeProvider.margin72),
_buildContent(),
const SizedBox(height: ThemeProvider.margin24),
_buildSubmitPassButton()
],
),
),
),
),
Expand All @@ -89,53 +91,49 @@ class _DerivChooseNewPassLayoutState extends State<DerivChooseNewPassLayout> {

return true;
},
child: SingleChildScrollView(
child: Column(
children: <Widget>[
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: <Widget>[
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,
),
],
),
),
],
),
);

Expand Down

0 comments on commit abd0568

Please sign in to comment.