![]() Even though it doesn’t provide interaction for players yet, the game does have a complete UI. ![]() You’ll work on implementing it in this tutorial by using Bloc 8.0. In summary, all the game logic is missing. Also, when you tap the stats icon in the top-right corner of the screen, all the stats show as negative numbers. Plingo doesn’t display anything when you tap a key on the on-screen keyboard. At this point, you’ll see the following:Īs you can tell, the most critical aspects of the game are missing. widgets contains all the reusable widgets.īuild and run the starter project using the emulator of your preference or a mobile device.cubit has a cubit definition for handling the stats displayed in an in-game dialog.bloc has a bloc definition for handling game interactions and possible outcomes from it, like winning or losing.presentation: Contains different folders that build the game’s UI:.monitoring: A folder with a helper class that helps you track your Blocs and cubits.app: A folder with the app widget and also a helper file with colors defined by the brand guidelines.data.dart: Contains the classes that interact with storage and allows for better data handling.domain.dart: Contains the game logic and corresponding class definitions.main.dart: Standard main file required for Flutter projects.Here’s a quick rundown of how the project is set up: If the user fails to guess correctly, then the streak resets. If the user guesses the word, they’ll start or increase a winning streak. ![]() There’s a new random word to guess each time you play. You have to guess a five-letter word within five attempts to win. In this tutorial, you’ll develop an app called Plingo, a word-guessing game like Wordle. If VS Code doesn’t get the dependencies automatically, then download them by opening pubspec.yaml and clicking the get package icon in the top-right corner or by running the command flutter pub get from the terminal. VS Code should show a notification prompting you to click it to get the dependencies for the project. ![]() Use a recent version of Flutter, 2.10 or above. You can also use Android Studio, but you’ll have to adapt the instructions below as needed. Then, open the starter project in VS Code 1.66 or later. To learn more about them, check out Getting Started with the BLoC Pattern and Bloc’s documentation and tutorials or learn about State Management With Provider.ĭownload the starter project by clicking Download Materials at the top or bottom of the tutorial. Note: This tutorial assumes you have intermediate knowledge of stateful and stateless widgets, usage of previous versions of Bloc and provider. ![]()
0 Comments
Leave a Reply. |