Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #760 from egovernments/PFM-5983-flutter
Browse files Browse the repository at this point in the history
PFM-5983: Password length max set to 10, Fixed uppercase not giving hint
  • Loading branch information
pradeepkumarcm-egov authored Apr 3, 2024
2 parents 71e10c9 + c5611ab commit 8623f97
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class _ChangePasswordState extends State<ChangePassword> {
passwordDetails.currentpasswordCtrl,
obscureText: true,
isRequired: true,
maxLength: 10,
maxLines: 1,
onChange: (value) => saveInput(value),
key: Keys.changePassword.CURRENT_PASSWORD_KEY,
Expand All @@ -94,6 +95,7 @@ class _ChangePasswordState extends State<ChangePassword> {
passwordDetails.newpasswordCtrl,
obscureText: true,
isRequired: true,
maxLength: 10,
maxLines: 1,
validator: (val) => Validators.passwordComparision(
val, ApplicationLocalizations.of(context).translate(i18.password.NEW_PASSWORD_ENTER)),
Expand All @@ -105,6 +107,7 @@ class _ChangePasswordState extends State<ChangePassword> {
passwordDetails.confirmpasswordCtrl,
obscureText: true,
isRequired: true,
maxLength: 10,
maxLines: 1,
validator: (val) => Validators.passwordComparision(
val,
Expand Down
3 changes: 3 additions & 0 deletions frontend/mgramseva/lib/utils/constants/i18_key_constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ class Password {
'CORE_PASS_HINT_ATLEAST_ONE_LETTER';
String get PASS_HINT_ATLEAST_ONE_NUMBER =>
'CORE_PASS_HINT_ATLEAST_ONE_NUMBER';
String get PASS_HINT_ATLEAST_ONE_UPPERCASE =>
'CORE_PASS_HINT_ATLEAST_ONE_UPPERCASE';
String get PASS_HINT_ATLEAST_ONE_SPECIAL_CHARACTER =>
'CORE_PASS_HINT_ATLEAST_ONE_SPECIAL_CHARACTER';
String get ENTER_OTP_SENT_TO => 'ENTER_OTP_SENT_TO';
Expand All @@ -277,6 +279,7 @@ class Password {
String get NEW_PASSWORD_ENTER => 'NEW_PASSWORD_ENTER';
String get CONFIRM_PASSWORD_ENTER => 'CONFIRM_PASSWORD_ENTER';
String get INVITED_TO_SINGLE_GP => 'INVITED_TO_SINGLE_GP';

}

class Expense {
Expand Down
17 changes: 17 additions & 0 deletions frontend/mgramseva/lib/widgets/password_hint.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,23 @@ class PasswordHint extends StatelessWidget {
color: Colors.green[900],
)
: Text("")
]),
SizedBox(height: 5),
Row(children: [
Text(
ApplicationLocalizations.of(context).translate(i18.password.PASS_HINT_ATLEAST_ONE_UPPERCASE),
style: TextStyle(
fontSize: 16,
color: RegExp(r'^(?=.*[A-Z])').hasMatch(inputPassword)
? Colors.green[900]
: Theme.of(context).hintColor),
),
new RegExp(r'^(?=.*[A-Z])').hasMatch(inputPassword)
? Icon(
Icons.check,
color: Colors.green[900],
)
: Text("")
])
],
)),
Expand Down

0 comments on commit 8623f97

Please sign in to comment.