From 9baacc3c9eeef73c3c06ac00a28a4524722c6993 Mon Sep 17 00:00:00 2001 From: yaso-meth Date: Fri, 2 Aug 2024 10:48:12 +0200 Subject: [PATCH] error message added for password requirements & update password match error message --- .../lib/components/myErrorMessage.dart | 46 ++++++++++++++++++- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/Frontend/patient_manager/lib/components/myErrorMessage.dart b/Frontend/patient_manager/lib/components/myErrorMessage.dart index 840e1ab2..102a439d 100644 --- a/Frontend/patient_manager/lib/components/myErrorMessage.dart +++ b/Frontend/patient_manager/lib/components/myErrorMessage.dart @@ -160,7 +160,7 @@ class _MyErrorMessageState extends State { Padding( padding: EdgeInsets.symmetric(horizontal: 25.0), child: Text( - "Your password doesn't meet our security standards. Please ensure that your password contain at least one letter.\n\nFor added security please try again using a combination of letters, numbers, and special characters for a stronger password.", + "Oops! Your password doesn't quite meet our standards. To keep your account secure, please make sure your password meets the following requirements", style: TextStyle( color: MzanziInnovationHub.of(context)! .theme @@ -170,6 +170,48 @@ class _MyErrorMessageState extends State { ), ), ), + const SizedBox(height: 10), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 25.0), + child: RichText( + text: TextSpan( + style: TextStyle( + color: MzanziInnovationHub.of(context)! + .theme + .secondaryColor(), + fontSize: 15.0, + fontWeight: FontWeight.bold, + ), + children: [ + TextSpan( + text: "Requirements:\n", + style: TextStyle( + fontStyle: FontStyle.italic, + color: MzanziInnovationHub.of(context)! + .theme + .errorColor())), + const TextSpan( + text: "1) Contailes at least 8 characters\n", + ), + const TextSpan( + text: + "2) Contains at least 1 uppercase letter (A-Z)\n", + ), + const TextSpan( + text: + "3) Contains at least 1 lowercase letter (a-z)\n", + ), + const TextSpan( + text: "4) Contains at least 1 number (0-9)\n", + ), + const TextSpan( + text: + "5) Contains at least 1 special character (!@#\$%^&*)\n", + ), + ], + ), + ), + ), ], ), ), @@ -295,7 +337,7 @@ class _MyErrorMessageState extends State { } void setPwdMatchError() { - messageTypes["Password"] = Stack( + messageTypes["Password Match"] = Stack( children: [ Container( padding: const EdgeInsets.all(10.0),