A comprehensive quiz application built with Flutter, Firebase Authentication, and Cloud Firestore.
- ✅ Email/Password Authentication
- ✅ Profile Management
- ✅ Quiz Categories Selection
- ✅ Multiple Choice & True/False Questions
- ✅ 15-second timer per question
- ✅ Real-time score tracking
- ✅ Detailed results with answer breakdown
- ✅ Quiz history tracking
- ✅ Purple-themed modern UI
- ✅ Admin dashboard with dark theme
- ✅ Add new quiz questions
- ✅ Create user accounts
- ✅ View all quiz results across users
- ✅ Searchable and sortable results table
- Framework: Flutter 3.x
- State Management: Provider
- Backend: Firebase
- Firebase Authentication
- Cloud Firestore
- UI: Material Design 3 with custom purple theme
- Flutter SDK (3.0 or higher)
- Firebase Project
- Android Studio / VS Code
- Git
git clone <your-repo-url>
cd Quizzicalflutter pub get# Install FlutterFire CLI
dart pub global activate flutterfire_cli
# Configure Firebase
flutterfire configureThis will automatically create firebase_options.dart with your Firebase configuration.
- Go to Firebase Console
- Create a new project or use an existing one
- Add Android/iOS/Web apps
- Download configuration files:
- Android:
google-services.json→android/app/ - iOS:
GoogleService-Info.plist→ios/Runner/
- Android:
- Update
lib/firebase_options.dartwith your project credentials
- Go to Firebase Console → Authentication
- Enable Email/Password sign-in method
- Go to Firebase Console → Firestore Database
- Click "Create database"
- Start in test mode (update rules later)
- Choose your preferred location
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Users collection
match /users/{userId} {
allow read: if request.auth != null;
allow write: if request.auth.uid == userId ||
get(/databases/$(database)/documents/users/$(request.auth.uid)).data.isAdmin == true;
}
// Categories collection
match /categories/{categoryId} {
allow read: if request.auth != null;
allow write: if get(/databases/$(database)/documents/users/$(request.auth.uid)).data.isAdmin == true;
}
// Questions collection
match /questions/{questionId} {
allow read: if request.auth != null;
allow write: if get(/databases/$(database)/documents/users/$(request.auth.uid)).data.isAdmin == true;
}
// Results collection
match /results/{resultId} {
allow read: if request.auth != null;
allow create: if request.auth != null && request.resource.data.userId == request.auth.uid;
allow update, delete: if false;
}
}
}In Firestore Console, create documents in the categories collection:
// Document 1
{
"name": "General Knowledge",
"displayOrder": 1
}
// Document 2
{
"name": "Science & Nature",
"displayOrder": 2
}
// Document 3
{
"name": "History",
"displayOrder": 3
}
// Document 4
{
"name": "Sports",
"displayOrder": 4
}
// Document 5
{
"name": "Geography",
"displayOrder": 5
}
// Document 6
{
"name": "Entertainment",
"displayOrder": 6
}In Firestore Console, create documents in the questions collection:
// Example Multiple Choice Question
{
"category": "General Knowledge",
"type": "multiple",
"question": "What is the capital of France?",
"correct_answer": "Paris",
"incorrect_answers": ["London", "Berlin", "Madrid"],
"difficulty": "easy"
}
// Example True/False Question
{
"category": "Science & Nature",
"type": "boolean",
"question": "The Earth is flat.",
"correct_answer": "False",
"incorrect_answers": ["True"],
"difficulty": "easy"
}- Run the app and sign up with an email
- Go to Firestore Console →
userscollection - Find your user document and add:
{ ...existing fields, "isAdmin": true }
- Restart the app to see admin features
# Run on connected device/emulator
flutter run
# Run in debug mode
flutter run --debug
# Run in release mode
flutter run --releaselib/
├── main.dart # App entry point
├── firebase_options.dart # Firebase configuration
├── models/ # Data models
│ ├── user_model.dart
│ ├── category_model.dart
│ ├── question_model.dart
│ └── result_model.dart
├── providers/ # State management
│ └── auth_provider.dart
├── screens/ # UI screens
│ ├── auth_screen.dart # Login/Signup
│ ├── user_home_screen.dart # User dashboard
│ ├── admin_home_screen.dart # Admin dashboard
│ ├── new_quiz_screen.dart # Quiz interface
│ ├── new_results_screen.dart # Results display
│ ├── quiz_history_screen.dart # Quiz history
│ ├── profile_screen.dart # User profile
│ ├── admin_add_question_screen.dart
│ ├── admin_add_user_screen.dart
│ └── admin_results_screen.dart
└── services/ # Business logic
├── auth_service.dart # Authentication
└── firestore_service.dart # Database operations
- Sign Up/Login: Create an account or login
- Select Quiz: Choose category and question type
- Take Quiz: Answer 10 questions with 15-second timer
- View Results: See score and detailed breakdown
- Check History: View all previous quiz attempts
- Edit Profile: Update your name and account details
- Add Questions: Create MCQ or True/False questions
- Add Users: Create user accounts directly
- View Results: See all quiz results across users
- Manage: Full CRUD capabilities for quiz content
- Question difficulty filtering
- Leaderboard system
- Quiz sharing
- Offline mode
- Dark mode toggle for users
- Question images/media support
- Translation (English ↔ Bangla)
- Email verification
- Password reset functionality
- Social authentication (Google, Facebook)
- Analytics dashboard
- Export results to PDF/CSV
- Verify
google-services.json(Android) orGoogleService-Info.plist(iOS) is in the correct location - Check Firebase project settings match your app package name
- Ensure internet connection is available
# Clean build
flutter clean
flutter pub get
flutter run- Check Firebase Authentication is enabled
- Verify email/password sign-in method is activated
- Check security rules in Firestore
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is created for educational purposes.
For questions or support, please contact the development team.
Built with ❤️ using Flutter & Firebase