

{"id":123328,"date":"2024-06-10T18:00:05","date_gmt":"2024-06-10T12:30:05","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=123328"},"modified":"2026-06-01T14:21:26","modified_gmt":"2026-06-01T08:51:26","slug":"flutter-dice-roll-app","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/flutter-dice-roll-app\/","title":{"rendered":"Flutter Project &#8211; Dice Roll App"},"content":{"rendered":"<p>Whether you&#8217;re playing board games, making decisions, or simply seeking a bit of randomness, a Dice Roll App in Flutter can provide you with endless fun and utility. It is a two-player app where a random number will be generated for each player and added to their scores at each turn, and the player with the highest score wins. Users can also clear the scores to start a new game.<\/p>\n<h2>About Flutter Dice Roll App<\/h2>\n<p>In this Flutter Dice Roll Project, we will embark on a journey to create a Dice Roll App using Flutter. You will learn the basics of Flutter development, including UI design, user interactions, and how to incorporate random number generation to simulate the roll of a physical die. By the end of this Flutter Dice Roll project, you&#8217;ll have a fully functional Flutter app that you can use and customize as you see fit.<\/p>\n<h3>Prerequisites For Flutter Dice Roll Project<\/h3>\n<p><strong>First, let\u2019s install the below-mentioned required software to build the Flutter Dice Roll app:<\/strong><\/p>\n<p><strong>(i) Flutter &#8211;<\/strong> Refer to the link for installing <a href=\"https:\/\/docs.flutter.dev\/get-started\/install\">Flutter<\/a>, depending on your operating system.<\/p>\n<p><strong>(ii) Android Studio &#8211;<\/strong> You can download <a href=\"https:\/\/developer.android.com\/studio\">Android Studio<\/a>. This is necessary as it will run the app in the Android emulator.<\/p>\n<p><strong>(iii) Visual Studio Code &#8211;<\/strong> Although this is not necessary, you can also build apps in Android Studio. But in our case, we have used <a href=\"https:\/\/code.visualstudio.com\/download\">VS code<\/a> as it is a good code editor. You can also download it from here.<\/p>\n<p>Now that the setup is ready, let\u2019s get started!<\/p>\n<h3>Creating a New Dice Roll Project\u00a0 in Flutter<\/h3>\n<p>Let\u2019s start with creating a new Flutter Dice Roll Project through the Flutter terminal. <strong>Go to the directory where you want to save the project using:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">cd  $Project-directory-path<\/pre>\n<p><strong>Then create a new project using the below command:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">flutter create tic-tac-toe<\/pre>\n<h3>Download Flutter Dice Roll Project<\/h3>\n<p>Please download the source code of the Flutter Dice Roll Project:<a href=\"https:\/\/drive.google.com\/file\/d\/1PMl0W68_AERJ83VrsLdDd0GtEEtYeN77\/view?usp=drive_link\"> <strong>Flutter Dice Roll Project Code.<\/strong><\/a><\/p>\n<h3>Steps to Build Flutter Dice Roll App Project<\/h3>\n<h4>1. Starting with the Main Layout of the App<\/h4>\n<p>Let\u2019s start with building the main structure of the app. For this, we have imported the material. dart package. We have used Scaffold to build the general layout and added the AppBar to give a title for the app. In the body, we are returning GradientContainer, which is a custom widget we will build next.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import 'package:flutter\/material.dart';\r\n\r\nimport '.\/gradient_container.dart';\r\n\r\nconst bgColor1 = Color.fromARGB(255, 26, 2, 80);\r\nconst bgColor2 = Color.fromARGB(255, 45, 7, 98);\r\nvoid main() {\r\n  runApp(\r\n    MaterialApp(\r\n      home: Scaffold(\r\n        appBar: AppBar(\r\n          title: const Text('Dice Roll by DataFlair'),\r\n          backgroundColor: const Color.fromARGB(255, 40, 5, 73),\r\n        ),\r\n        body: const GradientContainer(bgColor1, bgColor2),\r\n      ),\r\n    ),\r\n  );\r\n}<\/pre>\n<p>The below code shows the GradientContainer widget, which is a stateless widget, as the state will remain the same in this widget. Through this, we add the gradient for the main screen of the app. Here in the build function, we return a Container and, using its decoration property sets the LinearGradient for the app. In the container&#8217;s child, we return a custom widget, DiceRoller, which we will see next.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import 'package:flutter\/material.dart';\r\n\r\nimport '.\/dice_roller.dart';\r\n\r\nconst bgStartAlignment = Alignment.topLeft;\r\nconst bgEndAlignment = Alignment.bottomRight;\r\n\r\n\/\/ ignore: must_be_immutable\r\nclass GradientContainer extends StatelessWidget {\r\n  const GradientContainer(this.color1, this.color2, {super.key});\r\n\r\n  final Color color1;\r\n  final Color color2;\r\n\r\n  @override\r\n  Widget build(BuildContext context) {\r\n    return Container(\r\n      width: double.infinity,\r\n      height: double.infinity,\r\n      decoration: BoxDecoration(\r\n        gradient: LinearGradient(\r\n          colors: [\r\n            color1,\r\n            color2,\r\n          ],\r\n          begin: bgStartAlignment,\r\n          end: bgEndAlignment,\r\n        ),\r\n      ),\r\n      child: const DiceRoller(),\r\n    );\r\n  }\r\n}<\/pre>\n<h4>2. Building the Home Screen of the App<\/h4>\n<p>Here DiceRoller is a custom widget through which we will show the content\/home screen of the app. It is a StateFul widget, as the content on the screen needs to be changed when the user rolls the dice or the scores get updated. Here firstly, we initialize the variables to store the scores of players and keep track of which player\u2019s turn is it.<\/p>\n<p>We create two functions, one called rollDice, which will change the dice image as the user clicks on the button and updates the scores of players. Another function, called clearScores, as the name suggests, is to clear the scores of players and initialize them to 0.<\/p>\n<p>Through this widget, we return the app&#8217;s content using the Column widget and set the main axis size to a minimum. In the children argument, we return the PlayerScores widget, which is a custom widget to show the scores of the player, an Image of the dice, text button to roll the dice, through which the rollDice function gets executed as we see above, and another text button to clear the scores of the players. In between each of these widgets, we use SizedBox to set the gap b\/w various elements.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import 'dart:math';\r\n\r\nimport 'package:flutter\/material.dart';\r\nimport 'widgets\/player_scores.dart';\r\n\r\nfinal randomizer = Random();\r\n\r\nclass DiceRoller extends StatefulWidget {\r\n  const DiceRoller({super.key});\r\n  @override\r\n  State&lt;DiceRoller&gt; createState() {\r\n    return _DiceRollerState();\r\n  }\r\n}\r\n\r\nclass _DiceRollerState extends State&lt;DiceRoller&gt; {\r\n  var currentDiceRoll = 2;\r\n\r\n  var player1Score = 0;\r\n  var player2Score = 0;\r\n\r\n  var player1Turn = true;\r\n\r\n  void rollDice() {\r\n    setState(\r\n      () {\r\n        currentDiceRoll = randomizer.nextInt(6) + 1;\r\n        if (player1Turn) {\r\n          player1Score += currentDiceRoll;\r\n        } else {\r\n          player2Score += currentDiceRoll;\r\n        }\r\n        player1Turn = !player1Turn;\r\n      },\r\n    );\r\n  }\r\n\r\n  void clearScores() {\r\n    setState(() {\r\n      player1Score = 0;\r\n      player2Score = 0;\r\n    });\r\n  }\r\n\r\n  @override\r\n  Widget build(BuildContext context) {\r\n    return Column(\r\n      mainAxisSize: MainAxisSize.min,\r\n      children: [\r\n        Padding(\r\n          padding: const EdgeInsets.symmetric(horizontal: 18, vertical: 24),\r\n          child: PlayerScores(\r\n              player1Score: player1Score, player2Score: player2Score),\r\n        ),\r\n        const SizedBox(\r\n          height: 60,\r\n        ),\r\n        Image.asset(\r\n          'assets\/dice-$currentDiceRoll.png',\r\n          width: 200,\r\n        ),\r\n        const SizedBox(\r\n          height: 20,\r\n        ),\r\n        TextButton(\r\n          onPressed: rollDice,\r\n          style: TextButton.styleFrom(\r\n            \/\/ padding: const EdgeInsets.only(top: 20),\r\n            foregroundColor: Colors.white,\r\n            textStyle: const TextStyle(fontSize: 28),\r\n          ),\r\n          child: const Text('Roll Dice!'),\r\n        ),\r\n        TextButton.icon(\r\n          onPressed: clearScores,\r\n          style: TextButton.styleFrom(\r\n            \/\/ padding: const EdgeInsets.only(top: 20),\r\n            foregroundColor: const Color.fromARGB(255, 190, 189, 189),\r\n            textStyle: const TextStyle(fontSize: 21),\r\n          ),\r\n          label: const Text('Clear Scores'),\r\n          icon: const Icon(Icons.refresh),\r\n        ),\r\n      ],\r\n    );\r\n  }\r\n}<\/pre>\n<h4>3. Helper Widgets<\/h4>\n<p>To help build the UI of the app, we created two custom helper widgets, PlayerScores and StyledText.<\/p>\n<p>PlayerScores is a stateless widget which we built to show the scores of the players. Through the constructor function, we accept the player 1 and player 2 scores. In the build function, we return a Row widget as both player&#8217;s scores need to be displayed horizontally. In the children argument of the row widget, we return two Column widgets separated by a Spacer widget. In each of the Column widgets, we show which player score it is and the score below it, which we are accepting through the constructor function through the Text widget in which we have added the styling.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import 'package:flutter\/material.dart';\r\n\r\nclass PlayerScores extends StatelessWidget {\r\n  const PlayerScores(\r\n      {required this.player1Score, required this.player2Score, super.key});\r\n\r\n  final int player1Score;\r\n  final int player2Score;\r\n  @override\r\n  Widget build(BuildContext context) {\r\n    return Row(\r\n      children: [\r\n        Column(\r\n          children: [\r\n            const Text(\r\n              'Player1',\r\n              style: TextStyle(\r\n                fontSize: 23,\r\n                fontWeight: FontWeight.bold,\r\n                color: Color.fromARGB(255, 215, 215, 5),\r\n              ),\r\n            ),\r\n            const SizedBox(\r\n              height: 10,\r\n            ),\r\n            Text(\r\n              player1Score.toString(),\r\n              style: const TextStyle(\r\n                fontSize: 25,\r\n                color: Color.fromARGB(255, 215, 215, 5),\r\n              ),\r\n            )\r\n          ],\r\n        ),\r\n        const Spacer(),\r\n        Column(\r\n          children: [\r\n            const Text(\r\n              'Player2',\r\n              style: TextStyle(\r\n                  fontSize: 23,\r\n                  fontWeight: FontWeight.bold,\r\n                  color: Color.fromARGB(255, 215, 215, 5)),\r\n            ),\r\n            const SizedBox(\r\n              height: 10,\r\n            ),\r\n            Text(\r\n              player2Score.toString(),\r\n              style: const TextStyle(\r\n                  fontSize: 25, color: Color.fromARGB(255, 215, 215, 5)),\r\n            )\r\n          ],\r\n        ),\r\n      ],\r\n    );\r\n  }\r\n}<\/pre>\n<p>In StyledText, we return a Text widget with custom styling which we can use in our app so that we don\u2019t need to create each time and help with code redundancy in our app.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import 'package:flutter\/material.dart';\r\n\r\nclass StyledText extends StatelessWidget {\r\n  const StyledText(this.text, {super.key});\r\n\r\n  final String text;\r\n\r\n  @override\r\n  Widget build(BuildContext context) {\r\n    return Text(\r\n      text,\r\n      style: const TextStyle(fontSize: 28, color: Colors.white),\r\n    );\r\n  }\r\n}<\/pre>\n<h3>Flutter Dice Roll Output<\/h3>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/12\/flutter-dice-roll-app-output.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-132883 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/12\/flutter-dice-roll-app-output.webp\" alt=\"flutter dice roll app output\" width=\"615\" height=\"628\" \/><\/a><\/p>\n<h3>Conclusion<\/h3>\n<p>I hope you had a good time working on this Flutter Dice Roll Project! Through this Flutter Dice Roll project, we got to learn about how to apply gradients in the app, how to show images in the app, how to create text buttons with icons, and how to pass variables as well as functions as arguments through the constructor function. With this Flutter project, you can enjoy playing the game of rolling dice. You can also extend and use this project as part of your custom implementation.<\/p>\n<p>I hope you enjoyed working on this project!<br \/>\nThank you for reading! Keep Learning Flutter!<span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:104,&quot;href&quot;:&quot;https:\\\/\\\/docs.flutter.dev\\\/get-started\\\/install&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20250914042324\\\/https:\\\/\\\/docs.flutter.dev\\\/get-started\\\/install&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-05 21:21:00&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-10 11:35:53&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-13 15:22:01&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-16 23:25:27&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-20 05:48:48&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-23 20:06:31&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-27 02:37:50&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-30 06:04:07&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-03 08:38:13&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-06 15:40:23&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-10 16:01:56&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-14 09:38:23&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-17 17:00:08&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-21 03:52:14&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-24 14:31:20&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-29 04:30:04&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-02 06:09:04&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-06 16:05:19&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-11 06:18:59&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-15 16:39:34&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-23 19:54:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-27 11:36:36&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-03 02:56:23&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-07 21:41:59&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-11 19:44:31&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-15 11:06:43&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-22 12:54:22&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-26 02:54:47&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-02 13:36:10&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-06 15:34:06&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-10 06:29:56&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-13 12:55:56&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-18 07:13:02&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-21 08:07:48&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-26 16:50:52&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-29 22:58:23&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-03 15:32:29&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-06 23:55:20&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-12 01:48:22&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-15 20:55:56&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-19 17:46:14&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-22 18:34:44&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-26 13:42:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-31 15:28:25&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-05 03:46:23&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-08 15:19:03&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-13 01:12:06&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-16 02:14:19&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-20 07:49:46&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-23 19:18:06&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-28 04:16:03&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-07-02 02:12:43&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-07-02 02:12:43&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:105,&quot;href&quot;:&quot;https:\\\/\\\/developer.android.com\\\/studio&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20251202124635\\\/https:\\\/\\\/developer.android.com\\\/studio&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-05 21:21:07&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-09 10:52:29&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-12 14:56:07&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-16 00:19:09&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-19 07:25:53&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-22 10:42:11&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-26 03:17:56&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-29 06:25:55&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-01 10:52:49&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-04 17:32:46&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-08 15:52:46&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-11 22:04:15&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-15 00:17:50&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-18 14:43:54&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-22 12:08:47&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-25 13:13:07&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-29 01:03:13&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-01 18:04:59&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-05 06:37:55&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-08 09:12:53&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-11 13:41:30&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-15 11:39:22&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-18 13:52:15&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-21 16:17:18&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-25 02:36:20&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-28 05:56:50&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-03 14:23:47&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-07 01:25:34&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-10 10:45:18&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-13 23:35:02&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-17 04:39:01&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-20 04:41:40&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-23 06:47:41&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-26 17:19:43&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-30 07:29:08&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-02 13:36:10&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-05 18:44:52&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-08 20:57:23&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-11 22:58:17&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-15 10:52:19&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-18 16:28:10&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-22 05:16:23&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-26 02:09:28&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-29 08:32:16&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-02 14:37:35&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-05 17:27:15&quot;,&quot;http_code&quot;:429},{&quot;date&quot;:&quot;2026-05-09 00:11:31&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-12 03:42:11&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-15 05:35:22&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-19 07:55:47&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-22 16:31:55&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-26 13:42:38&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-30 15:02:52&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-06-02 16:31:52&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-06-06 12:02:38&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-06-10 16:59:14&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-06-13 18:01:54&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-06-17 05:27:52&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-06-22 00:49:18&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-06-26 11:58:19&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-06-29 14:46:02&quot;,&quot;http_code&quot;:503}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-29 14:46:02&quot;,&quot;http_code&quot;:503},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:106,&quot;href&quot;:&quot;https:\\\/\\\/code.visualstudio.com\\\/download&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20251204121135\\\/https:\\\/\\\/code.visualstudio.com\\\/download&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-05 21:21:11&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-09 06:36:09&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-13 13:39:51&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-16 16:39:19&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-20 05:48:47&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-23 15:52:52&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-26 16:42:55&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-30 06:04:07&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-03 08:38:13&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-06 11:44:47&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-09 15:03:55&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-12 17:34:08&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-16 07:23:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-19 08:10:24&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-22 12:08:46&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-25 13:13:06&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-28 16:33:40&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-02 06:09:04&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-05 11:09:13&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-10 05:12:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-13 09:16:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-16 09:57:52&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-20 19:12:00&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-24 07:09:55&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-27 11:07:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-03 02:56:23&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-06 10:14:55&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-10 09:42:31&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-13 21:54:55&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-17 09:04:15&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-22 09:38:30&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-25 18:47:58&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-29 09:14:33&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-01 13:26:26&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-05 13:53:54&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-08 14:38:46&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-12 03:23:57&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-15 10:52:19&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-18 16:28:11&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-22 05:16:24&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-25 15:25:43&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-28 18:00:52&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-02 00:06:57&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-05 06:50:53&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-11 05:39:12&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-14 08:20:31&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-17 14:13:55&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-21 06:49:17&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-25 07:48:29&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-28 08:01:28&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-31 15:28:21&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-03 17:34:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-06 23:32:44&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-10 14:18:20&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-13 15:09:34&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-17 05:27:51&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-21 17:20:09&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-26 11:58:19&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-30 04:57:07&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-30 04:57:07&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:2613,&quot;href&quot;:&quot;https:\\\/\\\/drive.google.com\\\/file\\\/d\\\/1PMl0W68_AERJ83VrsLdDd0GtEEtYeN77\\\/view?usp=drive_link&quot;,&quot;archived_href&quot;:&quot;&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[],&quot;broken&quot;:false,&quot;last_checked&quot;:null,&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Whether you&#8217;re playing board games, making decisions, or simply seeking a bit of randomness, a Dice Roll App in Flutter can provide you with endless fun and utility. It is a two-player app where&#46;&#46;&#46;<\/p>\n","protected":false},"author":86671,"featured_media":123984,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28289],"tags":[30272,30271,30270,30249,30268,30269,30252,30250,30267],"class_list":["post-123328","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-flutter-tutorials","tag-dice-roll-app","tag-dice-roll-app-project-using-flutter","tag-dice-roll-app-using-flutter","tag-flutter","tag-flutter-dice-roll-app","tag-flutter-dice-roll-app-project","tag-flutter-project-ideas","tag-flutter-projects","tag-flutter-projects-for-practice"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Flutter Project - Dice Roll App - DataFlair<\/title>\n<meta name=\"description\" content=\"In this Flutter Dice Roll App you&#039;ll learn UI design, and how to incorporate random number generation to simulate the roll of a physical die.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/flutter-dice-roll-app\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Flutter Project - Dice Roll App - DataFlair\" \/>\n<meta property=\"og:description\" content=\"In this Flutter Dice Roll App you&#039;ll learn UI design, and how to incorporate random number generation to simulate the roll of a physical die.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/flutter-dice-roll-app\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-06-10T12:30:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-01T08:51:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/dice-roll.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Flutter Project - Dice Roll App - DataFlair","description":"In this Flutter Dice Roll App you'll learn UI design, and how to incorporate random number generation to simulate the roll of a physical die.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/flutter-dice-roll-app\/","og_locale":"en_US","og_type":"article","og_title":"Flutter Project - Dice Roll App - DataFlair","og_description":"In this Flutter Dice Roll App you'll learn UI design, and how to incorporate random number generation to simulate the roll of a physical die.","og_url":"https:\/\/data-flair.training\/blogs\/flutter-dice-roll-app\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2024-06-10T12:30:05+00:00","article_modified_time":"2026-06-01T08:51:26+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/dice-roll.webp","type":"image\/webp"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/flutter-dice-roll-app\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/flutter-dice-roll-app\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/0e594f928e31fc96628ac40f6ae74f49"},"headline":"Flutter Project &#8211; Dice Roll App","datePublished":"2024-06-10T12:30:05+00:00","dateModified":"2026-06-01T08:51:26+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/flutter-dice-roll-app\/"},"wordCount":949,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/flutter-dice-roll-app\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/dice-roll.webp","keywords":["dice roll app","dice roll app project using flutter","dice roll app using flutter","flutter","flutter dice roll app","flutter dice roll app project","flutter project ideas","flutter projects","flutter projects for practice"],"articleSection":["Flutter Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/flutter-dice-roll-app\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/flutter-dice-roll-app\/","url":"https:\/\/data-flair.training\/blogs\/flutter-dice-roll-app\/","name":"Flutter Project - Dice Roll App - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/flutter-dice-roll-app\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/flutter-dice-roll-app\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/dice-roll.webp","datePublished":"2024-06-10T12:30:05+00:00","dateModified":"2026-06-01T08:51:26+00:00","description":"In this Flutter Dice Roll App you'll learn UI design, and how to incorporate random number generation to simulate the roll of a physical die.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/flutter-dice-roll-app\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/flutter-dice-roll-app\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/flutter-dice-roll-app\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/dice-roll.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/dice-roll.webp","width":1200,"height":628,"caption":"dice roll"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/flutter-dice-roll-app\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Flutter Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/flutter-tutorials\/"},{"@type":"ListItem","position":3,"name":"Flutter Project &#8211; Dice Roll App"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/0e594f928e31fc96628ac40f6ae74f49","name":"TechVidvan Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c89190da3d4010c71ba476b618ab10fdc2335c82cdfa0ad5002d98d0f2473444?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c89190da3d4010c71ba476b618ab10fdc2335c82cdfa0ad5002d98d0f2473444?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c89190da3d4010c71ba476b618ab10fdc2335c82cdfa0ad5002d98d0f2473444?s=96&d=mm&r=g","caption":"TechVidvan Team"},"description":"TechVidvan Team provides high-quality content &amp; courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.","url":"https:\/\/data-flair.training\/blogs\/author\/test001\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/123328","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/86671"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=123328"}],"version-history":[{"count":7,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/123328\/revisions"}],"predecessor-version":[{"id":148698,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/123328\/revisions\/148698"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/123984"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=123328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=123328"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=123328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}