# Flutter Firebase Auth and Firestore

 

Implement Firebase Authentication and private Firestore sync in Flutter, including ownership rules, state isolation, and emulator tests.

 

**Licence** MIT

 

**Source** DeLaParra Services

 [Download zip](<https://delaparra-services.nl/skills/flutter-firebase-auth-firestore/download>)   

# Flutter Firebase Auth and Firestore

 

Drive the authenticated UI from the auth-state stream. Recreate per-user subscriptions and state when the UID changes. Decide the disk-cache policy before constructing Firestore readers, and test sign-out with pending writes.

 

Put private data under the UID. Check that the authenticated UID matches the path on every relevant operation. For writes, validate allowed keys, types and limits. Test access with two real emulator identities, including direct reads, lists, invalid fields, and unauthenticated requests. App Check supplements identity and rules.

 

Keep the Admin SDK on trusted servers. Its operations bypass Firestore rules, so server functions must independently enforce ownership. Require recent login for account deletion and keep cleanup retryable.

 

## Files

 

- ` LICENSE ` 
- ` SKILL.md ` 
- ` SOURCE.md `

 

## Related terms

 

- [Offline-First Flutter Apps](<https://delaparra-services.nl/knowledge-hub/offline-first-flutter-apps>)

 

## Related services

 

- [App development](<https://delaparra-services.nl/services#service-02>)

 

[Installing an agent skill in Claude Code, Codex, Cursor and Copilot](<https://delaparra-services.nl/manuals/een-skill-installeren-in-je-ai-assistent>)

[HTML version](https://delaparra-services.nl/skills/flutter-firebase-auth-firestore)
