A modern implementation of the classic 2048 game using Flutter and Firebase.
- Classic 2048 Gameplay: Swipe to merge tiles and reach 2048!
- Authentication: Sign up and login using Email/Password (Firebase Auth).
- Guest Mode: Play anonymously without creating an account.
- Leaderboard: Compete with other players. The leaderboard displays the top scores and player names (authenticated users only).
- Game State Persistence: Your game progress is automatically saved. Resume your unfinished games when you return to the app!
- Session Persistence: Stay logged in across app restarts.
- Responsive Design: Beautiful UI with smooth animations.
- Frontend: Flutter (Dart)
- Backend: Firebase (Auth, Firestore)
- State Management: Provider
- Local Storage: SharedPreferences
-
Prerequisites:
- Flutter SDK installed.
- Firebase project set up.
-
Clone the repository:
git clone <repository-url> cd flutter_2048_game
-
Install Dependencies:
flutter pub get
-
Firebase Configuration:
- Ensure you have the
google-services.jsonfile inandroid/app/. - Ensure you have the
GoogleService-Info.plistfile inios/Runner/(if targeting iOS). - Add your SHA-1 fingerprint to the Firebase Console for Android authentication.
- Ensure you have the
-
Run the App:
flutter run
Run the unit tests to verify the game logic:
flutter testlib/main.dart: Entry point and app configuration.lib/screens/: UI screens (Auth, Game, Leaderboard).lib/providers/: State management (Auth, Game).lib/services/: Backend services (Database).lib/widgets/: Reusable UI components.