Skip to content

Welcome to the Flutter Tic Tac Toe repository! Play the classic game on your mobile device with sleek design and two-player mode. Perfect for learning Flutter or having fun with friends.

Notifications You must be signed in to change notification settings

SouhailKrs/Flutter-Tic-Tac-Toe

Repository files navigation

Tic Tac Toe


Introduction

The classic Tic Tac Toe game built using Flutter. To enhance the user experience, I implemented Hive as the local database, allowing players to view their games later. Additionally, I utilized hooks, a flutter implementation of React hooks, and Riverpod to efficiently manage the life-cycle of the Widget and state managment. mi

Features

  • Single Player : Challenge yourself against an AI powered by the MiniMax algorithm, known for its strategic decision-making in game theory. Experience an engaging gameplay where the AI selects optimal moves, making every match a test of your skills.

  • Multiplayer : Compete against friends, customize player names, and choose "X" or "O" to determine the Tic Tac Toe champion!

  • History : Easily access and review your past matches, stored locally using Hive.

State Management

This project utilizes Hooks and Riverpod for efficient state management:

Inspired by their React counterparts, Hooks offer a functional and reusable approach to constructing components, improving upon the usage of StatefulWidget. For instance, when using text field controllers, you have to manually dispose of them to prevent memory leaks, whereas hooks handle this automatically (useTextEditingController).

Riverpod, a state management library, distinguishes itself through its emphasis on simplicity, performance, and scalability. This library seamlessly integrates into Flutter's ecosystem and furnishes an accessible interface. Employing Riverpod, I've adeptly overseen the application's state, simplifying the management of intricate interplays among distinct components.

Combining Hooks and Riverpod has enabled me to create a cleaner and more efficient architecture for the Tic Tac Toe game, resulting in improved performance and maintainability.

                    

             

Build Process

  • Follow the Flutter Guide for getting started building a flutter project.
  • Clone or download the repo
git clone https://github.com/SouhailKrs/Flutter-Tic-Tac-Toe
  • Get dependencies
flutter pub get

About

Welcome to the Flutter Tic Tac Toe repository! Play the classic game on your mobile device with sleek design and two-player mode. Perfect for learning Flutter or having fun with friends.

Topics

Resources

Stars

Watchers

Forks