Prompt file imported from CodeCraftsmaniac/CSE226-Project-2 (
.github/prompts/flutter-native-google-auth.prompt.md). Copyright stays with the author.
Implement native Google-only authentication for this workspace's flutter client.
Scope:
- Edit only flutter_app unless a required configuration dependency is missing.
- Do not modify CLI, web_app, or backend auth flows unless explicitly required.
Reference implementation:
Requirements:
- Use native Google account picker UX (Perplexity-style), not browser/device-code flow.
- Keep Google as the only sign-in method.
- Mirror the reference flow:
GoogleSignIn(serverClientId: ...)- retrieve
idToken(and access token when available) - exchange with Supabase via
signInWithIdToken - persist session token and user profile
- support full logout (local session + Google sign-out)
- Reuse existing package/config where possible (
google-services.json, package id, OAuth credentials). - Ensure all auth-consuming screens use one consistent auth service/state.
- Preserve existing app styling and navigation behavior.
- Provide friendly errors for:
- config error (
ApiException: 10/DEVELOPER_ERROR) - cancelled sign-in
- network/auth backend failures
- config error (
- Run static checks on touched files and resolve new compile issues.
Response format:
- Files changed
- Why each change was made
- Verification commands run and result
- Manual setup still required (if any), especially SHA-1 / OAuth client setup