Quiz app with Flutter and Firebase
Log in, pick a topic, answer timed questions and climb a live leaderboard stored in Firestore.
Intermediateâą 14â20 hoursđĒ 7 stepsFlutterFirebase AuthCloud Firestore
What you'll learn
- âFirebase setup with FlutterFire
- âFirestore reads, writes and security rules
- âStreams for live data
What you'll build
- âGoogle or email sign-in
- âTopics and questions from Firestore
- âTimer and score
- âLive leaderboard
Step-by-step guide
- 1
Firebase project
Create it in the Firebase console; run flutterfire configure to add Android and iOS apps.
- 2
Auth
firebase_auth for email/password (and google_sign_in); listen to authStateChanges() to route between login and home.
- 3
Data model
Collections: topics/{id}/questions/{id} with text, options, answer; scores/{uid} with name and best.
- 4
Quiz screen
Load questions once, shuffle, 20-second timer per question with a Timer that you cancel on dispose.
- 5
Save scores
Write the best score only if higher, using a transaction.
- 6
Leaderboard
StreamBuilder on scores ordered by best descending, limit 20.
- 7
Security rules
Allow users to write only scores/{their uid}; questions are read-only for clients. Test rules in the emulator.
đ Make it stand out
- +Admin screen to add questions
- +Daily challenge
- +Offline mode