Skip to content

A game in which players turn over two cards at a time to discover matching images or symbols.

Notifications You must be signed in to change notification settings

sufyanism/Memory-Match-Game

Repository files navigation

🧠 Flutter Memory Match Game

📝 Description

This is a simple and engaging Flutter Memory Match Game in which players flip cards to identify matching pairs of emojis. It is an ideal beginner-level project for understanding Flutter UI principles, state management using setState(), and foundational game logic concepts such as matching, flipping, and resetting cards.

📱 Features

  • 4x4 Emoji-based card grid
  • Flip two cards to check for matches
  • Matched cards stay revealed
  • “Play Again” button after all pairs are matched
  • Clean, minimal Material UI
  • Pure Flutter — no external packages required

🚀 Getting Started

Follow these procedural steps to set up and execute the application:

1. Install Flutter

Follow the official Flutter installation guide: 👉 Flutter Setup Guide

2. Create a new Flutter project

flutter create memory_match_game

3. Replace the lib folder

Substitute the default lib directory with the provided tutorial codebase.

4. Run the application

flutter run

📂 Project Structure

memory_match_game/
│
├── lib/
│   ├── main.dart           → Application entry point and theme configuration
│   └── game_screen.dart    → Game logic and user interface layer
│
├── pubspec.yaml            → Dependency management file
└── README.md               → Documentation resource

🧠 How It Works

The gameplay mechanism involves duplicating and shuffling a list of emojis to form matching pairs. Each grid tile represents a concealed card that can be flipped upon user interaction.

When two cards are flipped:

  • If they match → they remain visible.
  • If they do not match → they revert to their hidden state after a brief delay. Upon successful matching of all pairs, the application displays a “Play Again” button to restart gameplay.

💻 Core Code Overview

  • _flipCard() → Handles the primary flipping and matching operations.
  • _startGame() → Initializes a new shuffled deck for a fresh round.
  • _isGameComplete → Validates completion status once all card pairs are matched. Additionally, the implementation employs AnimatedContainer for seamless color transitions during flip events.

Demo

Memory.Match.mp4

🎨 Future Improvements

  • Integrate advanced flip animations using AnimatedSwitcher or Transform widgets.
  • Incorporate scoring metrics and time-tracking features.
  • Introduce variable difficulty levels (3x4, 4x4, 6x6 grid configurations).
  • Substitute emojis with scalable images or vector icons.
  • Add immersive audio feedback and background music for enhanced user experience.

About Me

✨ I’m Sufyan bin Uzayr, an open-source developer passionate about building and sharing meaningful projects. You can learn more about me and my work at sufyanism.com or connect with me on Linkedin

Your all-in-one learning hub!

🚀 Explore courses and resources in coding, tech, and development at zeba.academy and code.zeba.academy. Empower yourself with practical skills through curated tutorials, real-world projects, and hands-on experience. Level up your tech game today! 💻✨

Zeba Academy is a learning platform dedicated to coding, technology, and development.
➡ Visit our main site: zeba.academy
➡ Explore hands-on courses and resources at: code.zeba.academy
➡ Check out our YouTube for more tutorials: zeba.academy
➡ Follow us on Instagram: zeba.academy

Thank you for visiting!

About

A game in which players turn over two cards at a time to discover matching images or symbols.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published