-
Notifications
You must be signed in to change notification settings - Fork 0
Enhancement/bloc use example #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the authentication architecture by moving business logic from the AuthService to the AuthCubit, demonstrating proper Bloc usage patterns. It also removes the GPT review GitHub action workflow.
Key changes:
- Architectural shift:
AuthServicenow acts as a thin wrapper around the repository, whileAuthCubithandles state management and orchestrates authentication logic - Dependency inversion:
AuthCubitnow depends onAuthServiceinstead of the opposite relationship - UI updates: Pages now interact directly with
AuthCubitinstead ofAuthService
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/domain/lib/bloc/auth/auth_cubit.dart | Added business logic methods (login, onValidate, logOut) and dependency on AuthService |
| modules/domain/lib/services/auth_service.dart | Simplified to thin wrapper around repository, removed cubit dependency and state management logic |
| modules/domain/lib/init.dart | Reordered dependency injection to reflect new architecture with AuthCubit depending on AuthService |
| app/lib/presentation/ui/pages/splash/splash_page.dart | Updated to use AuthCubit instead of AuthService, added post-frame callback pattern |
| app/lib/presentation/ui/pages/login/login_page.dart | Refactored to call AuthCubit methods, improved loading screen overlay implementation |
| app/lib/presentation/ui/pages/home/home_view.dart | Changed to use AuthCubit for logout functionality |
| app/lib/presentation/ui/custom/loading_screen.dart | Simplified widget by removing conditional rendering logic, now always displays loading indicator |
| modules/domain/test/auth_service_test.dart | Removed tests as they no longer apply to simplified service |
| modules/domain/test/auth_cubit_test.dart | Removed tests as cubit now has service dependency requiring different test approach |
| melos.yaml | Added run:web script for running app in Chrome |
| .github/workflows/rs-gpt-review.yml | Removed GPT review workflow |
| .github/pull_request_template.md | Removed GPT review mention from template |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
modules/domain/test/auth_service_test.dart:1
- Tests for
AuthServicewere removed, but the updatedAuthCubitwith newlogin(),onValidate(), andlogOut()methods lacks test coverage. Since the original cubit tests were also deleted, the enhanced AuthCubit now has no tests covering its new business logic.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description