🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101

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. 1

    Firebase project

    Create it in the Firebase console; run flutterfire configure to add Android and iOS apps.

  2. 2

    Auth

    firebase_auth for email/password (and google_sign_in); listen to authStateChanges() to route between login and home.

  3. 3

    Data model

    Collections: topics/{id}/questions/{id} with text, options, answer; scores/{uid} with name and best.

  4. 4

    Quiz screen

    Load questions once, shuffle, 20-second timer per question with a Timer that you cancel on dispose.

  5. 5

    Save scores

    Write the best score only if higher, using a transaction.

  6. 6

    Leaderboard

    StreamBuilder on scores ordered by best descending, limit 20.

  7. 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