https://github.com/souhailkrs/flutter-tic-tac-toe
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.
https://github.com/souhailkrs/flutter-tic-tac-toe
dart flutter hive riverpod tic-tac-toe
Last synced: 2 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/souhailkrs/flutter-tic-tac-toe
- Owner: SouhailKrs
- Created: 2023-07-26T19:40:29.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-27T13:45:53.000Z (about 1 year ago)
- Last Synced: 2024-07-27T14:54:52.561Z (about 1 year ago)
- Topics: dart, flutter, hive, riverpod, tic-tac-toe
- Language: Dart
- Homepage:
- Size: 943 KB
- Stars: 12
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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.
## 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:
* [**Hooks**](https://pub.dev/packages/flutter_hooks)
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**](https://pub.dev/packages/riverpod)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](https://docs.flutter.dev/) for getting started building a flutter
project.
- Clone or download the repo```{r klippy, echo=FALSE, include=TRUE}
git clone https://github.com/SouhailKrs/Flutter-Tic-Tac-Toe
```- Get dependencies
```{r klippy, echo=FALSE, include=TRUE}
flutter pub get
```