Problem
UserRepository is a domain interface, but it imports google_sign_in and exposes GoogleSignInAuthenticationEvent and GoogleSignInAccount. This leaks a platform SDK into the domain layer and forces unrelated repository fakes/use-case tests to depend on Google SDK types.
Evidence
lib/domain/repositories/user_repository.dart imports package:google_sign_in/google_sign_in.dart.
UserRepository exposes GoogleSignInAuthenticationEvent and GoogleSignInAccount.
lib/data/repositories/user_repository_impl.dart delegates SDK initialization/authentication through the repository interface and extracts the Google ID token from GoogleSignInAccount.
- Login UI calls
authenticateWithGoogle() and passes the SDK account back into signInWithGoogle().
- Web Google sign-in UI consumes SDK auth events from the domain repository and passes
event.user back to it.
- Multiple tests import
google_sign_in only because UserRepository fakes must implement SDK-typed members.
Proposed direction
Move Google SDK interaction behind a platform/auth adapter and keep UserRepository expressed in app-owned types. For example, introduce a domain-owned credential/value object containing the Google ID token, or collapse the flow into a use case that authenticates with the SDK outside the repository and calls the repository with primitive/app-owned credential data.
Acceptance criteria
lib/domain/repositories/user_repository.dart no longer imports package:google_sign_in/google_sign_in.dart.
- No
UserRepository method exposes GoogleSignIn* types.
- Mobile and web Google sign-in still work, including user-cancel handling.
- Repository tests and domain/use-case fakes no longer import
google_sign_in.
flutter analyze and relevant auth/user tests pass.
Source: Codex codebase audit on 2026-06-28.
Problem
UserRepositoryis a domain interface, but it importsgoogle_sign_inand exposesGoogleSignInAuthenticationEventandGoogleSignInAccount. This leaks a platform SDK into the domain layer and forces unrelated repository fakes/use-case tests to depend on Google SDK types.Evidence
lib/domain/repositories/user_repository.dartimportspackage:google_sign_in/google_sign_in.dart.UserRepositoryexposesGoogleSignInAuthenticationEventandGoogleSignInAccount.lib/data/repositories/user_repository_impl.dartdelegates SDK initialization/authentication through the repository interface and extracts the Google ID token fromGoogleSignInAccount.authenticateWithGoogle()and passes the SDK account back intosignInWithGoogle().event.userback to it.google_sign_inonly becauseUserRepositoryfakes must implement SDK-typed members.Proposed direction
Move Google SDK interaction behind a platform/auth adapter and keep
UserRepositoryexpressed in app-owned types. For example, introduce a domain-owned credential/value object containing the Google ID token, or collapse the flow into a use case that authenticates with the SDK outside the repository and calls the repository with primitive/app-owned credential data.Acceptance criteria
lib/domain/repositories/user_repository.dartno longer importspackage:google_sign_in/google_sign_in.dart.UserRepositorymethod exposesGoogleSignIn*types.google_sign_in.flutter analyzeand relevant auth/user tests pass.Source: Codex codebase audit on 2026-06-28.