Skip to content

Conversation

EslamMagdy12
Copy link
Collaborator

@EslamMagdy12 EslamMagdy12 commented Mar 30, 2025

This pull request implements the Forget Password, Email Verification, and Reset Password functionalities, integrating them seamlessly across the data, domain, and presentation layers. These enhancements ensure a smoother password recovery experience for users while improving code maintainability and structure. Additionally, minor optimizations and refactoring were done to enhance performance and maintain consistency across the project.

Changes Included:

🔹 Data Layer:

  • Added API endpoints in AuthRetrofitClient for:
    • Sending a forget password request.
    • Verifying the reset code.
    • Resetting the password.
  • Implemented Auth Remote Data Source to manage authentication-related API calls.
  • Created request and response models for:
    • forget_password
    • verify_reset_code
    • reset_password
  • Developed the Auth Repository Implementation to handle data fetching and processing.

🔹 Domain Layer:

  • Created new use cases for handling:
    • Forget password requests.
    • Reset code verification.
    • Password reset submission.
  • Integrated repository contracts to ensure structured data handling.

🔹 Presentation Layer:

  • Developed dedicated screens for:
    • Forget Password
    • Email Verification
    • Reset Password
  • Enhanced UI elements to provide a more user-friendly experience.
  • Improved widget performance by using const where applicable.

🔹 Localization & UI Enhancements:

  • Updated Arabic & English translation files (ar.json & en.json) to include new authentication-related strings.
  • Introduced PIN input theme customizations in app_theme.dart.

🔹 General Improvements:

  • Refactored API Exception Handling:
    • Renamed app_exception.dart to api_exception.dart for better clarity.
    • Updated all related imports accordingly.
    • Improved _extractErrorMessage in ApiManager to handle API errors more effectively.
  • Navigation Updates:
    • Registered Forget Password, Email Verification, and Reset Password routes in routes.dart.

📌 Pull Request Checklist

✅ General

  • This pull request is all my own work -- I have not plagiarized it.
  • The PR title follows the required format: type/FA-<issue-number>-TaskName.
  • The branch name follows the required format: feature/meaningful-name, fix/issue-description, etc.

📂 Code Quality

  • All filenames are in snake_case.
  • All functions and variable names follow Dart naming conventions.
  • All new code is formatted with dart format .

🛠 CI/CD Validation

  • Linting passes with dart analyze.
  • The branch name is validated against the allowed patterns.
  • The PR title is validated against the required format.

🚀 Testing

  • Unit tests are included for all new features and bug fixes.
  • flutter test --coverage has been run and the results reviewed.
  • The project builds successfully without errors.

📝 Additional Information

This update enhances the password recovery process, ensuring a structured and scalable implementation while improving user experience. Future updates will focus on adding unit tests to validate functionality and maintain reliability.

🔗 Related JIRA Ticket(s):

  • JIRA Issue: FA-2

📸 Screenshots (if applicable):

Forget Password Email Verification Reset Password
Forget Password Email Verification Reset Password

…emove unused imports, and remove relying on hardcoded colors and used the app_colors.
- All fields are required in request models.
- Added some missed async and await.
- Removed Pintheme from AppTheme.
- Removed BlocConsumer and used BlocListener Instead.
- Renamed again ApiException to AppException.
- Followed the same Architecture so moved Auth Remote DataSource Impl outside implementation folder
- Used Cubits with BaseState, and Equatable.
- Renamed forget_password_header to header because it used across many screens not just forget_password
- Added unit tests for ForgetPasswordUsecase, ResetPasswordUsecase, and VerifyResetCodeUsecase.
- Utilized Mockito for mocking the AuthRepo dependency.
- Ensured tests cover both success and failure scenarios for each use case.
- Updated dependencies and configurations to support testing.
- Removed the default widget test file.
…forget-password

# Conflicts:
#	lib/core/utils/di/di.config.dart
#	lib/core/utils/routes/routes.dart
#	lib/main.dart
#	pubspec.lock
#	test/widget_test.dart
Copy link
Collaborator

@ali72-20 ali72-20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great job eslam perfect style
keep going

- Updated forget password screens and widgets to depend on AppColors file
- Update localization files to include (Resend In) text
- Replaced public variables with private ones in:
  - AuthRemoteDataSourceImpl
  - EmailVerificationCubit
  - ForgetPasswordCubit
- This enhances encapsulation and prevents unintended external access.
- Included unit tests for the following components:
  - Forget Password Cubit
  - Auth Repository Implementation
  - Auth Remote Data Source Implementation
  - Forget Password Usecase
  - Reset Password Usecase
  - Verify Reset Code Usecase
@ahmedelazab1220 ahmedelazab1220 changed the title Feature/FA-2-Forget-Password ✅ Feature/FA-2-Forget-Password Apr 14, 2025
- Prevents memory leaks by canceling the timer in the `dispose` method.
…forget-password

# Conflicts:
#	assets/translations/ar.json
#	assets/translations/en.json
#	lib/core/utils/datasource_excution/api_manager.dart
#	lib/core/utils/di/di.config.dart
#	lib/core/utils/routes/routes.dart
#	lib/features/auth/data/data_source/contract/auth_remote_data_source.dart
#	lib/features/auth/data/data_source/remote/auth_remote_data_source_impl.dart
#	lib/features/auth/data/repo_impl/auth_repo_impl.dart
#	lib/features/auth/domain/repo/auth_repo.dart
#	lib/features/home/data/api/home_retrofit_client.dart
#	lib/features/home/data/api/home_retrofit_client.g.dart
#	lib/main.dart
#	pubspec.lock
#	pubspec.yaml
EslamMagdy12 and others added 17 commits April 24, 2025 15:59
…feature/fa-2-forget-password

# Conflicts:
#	assets/translations/ar.json
#	assets/translations/en.json
#	lib/core/utils/di/di.config.dart
#	lib/core/utils/routes/routes.dart
#	pubspec.yaml
…or consistency, and updated skeletonizer package.
chore(pubspec): update package versions in pubspec.lock
Fix link of demo video
@Ammar720 Ammar720 requested a review from ahmedelazab1220 July 18, 2025 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants