All features

Authentication for Flutter

Firebase authentication behind a repository boundary

The auth skill keeps Firebase types out of your app: the app talks in a domain User and a sealed AuthException, and a GoRouter redirect gates the routes.

What this feature covers

  • Accounts: Login, signup, sign-out and account deletion.
  • Session: A persisted session with a distinct unknown, active and unauthenticated status.
  • Email actions: Email verification and password reset through hosted links.
  • Social sign-in: Google and Apple sign-in, with the platform branches called out.
  • Route gating: A GoRouter redirect that whitelists public routes.

How Flutter Agent Kit implements it

The skill puts an AuthRepository boundary around firebase_auth: only the repository imports the SDK, and every method maps Firebase errors to a sealed AuthException so a raw Firebase code never reaches the UI. The session lives in a hand-written UserNotifier and userProvider, and the rest of the kit reads it, including routing, subscription gating and observability.

Details that break naive integrations are covered: google_sign_in 7 uses GoogleSignIn.instance and a single initialize(), the first null from authStateChanges() is not treated as signed out, and the GoRouter redirect handles ref.mounted and automatic retry correctly. It runs on Android, iOS, macOS and web.

Frequently asked questions

Is Google and Apple sign-in covered?

Yes. The skill covers Google sign-in on google_sign_in 7 and Apple sign-in, and it calls out each platform branch, including the web popup flow, because the two providers differ per platform.

How are routes protected?

A GoRouter redirect uses a whitelist of public routes, so a new route fails safe as protected instead of leaking. The gate reads the session status and never redirects on the unknown state during cold start.

Get Flutter Agent Kit

Flutter Agent Kit ships this as a ready feature skill, together with the AGENTS.md context layer and the rest of the skills. €99.99 one-time, lifetime updates, unlimited personal and commercial projects.

Browse all features included in Flutter Agent Kit.