Create Dice Roller App Using Flutter — Flutter App 1

Bishworaj Poudel
2 min readJul 17, 2020

--

Hello everyone, welcome you here. In this article I will tell you how to create dice roller App using flutter. We will make this app at the end of the video.

Dice roller App using flutter.

First create new flutter app using flutter create command. I created project using flutter create dice_roller command. Then open the project in vs code.

First download [6] dice images from https://github.com/itsmebrp/flutter_diceroller . Here I attached 6 images for each dice side. Download all the files. Create img folder on project directory and move all files to img folder.

Now you need to add image file to pubspec.yaml. Add the img to assets and save it. Now lets go to main.dart and clear all the texts.

Then, add the following code on main.dart and create new file named home_page.dart. In this file we created main function and add stateless widget.

main.dart file

Almost done now open home_page.dart and create a stateful widget named HomePage.

home_page.dart part 1
home_page.dart part 2
home_page.dart part 3

Now we are done with our code, run the app and enjoy. If you want to download code directly go to my github respo.

--

--