From c3f8eb4d7e65eadfd57c9f65319622df2ebfd814 Mon Sep 17 00:00:00 2001 From: Ayush Raj <58889205+AyushRajSharma@users.noreply.github.com> Date: Tue, 28 Apr 2020 01:13:34 +0530 Subject: [PATCH 1/3] Update .gitignore aadd --- .gitignore | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 47e0b4d6..d13f69a1 100644 --- a/.gitignore +++ b/.gitignore @@ -64,8 +64,4 @@ build/ **/ios/Runner/GeneratedPluginRegistrant.* # Exceptions to above rules. -!**/ios/**/default.mode1v3 -!**/ios/**/default.mode2v3 -!**/ios/**/default.pbxuser -!**/ios/**/default.perspectivev3 -!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages + From 550db83813111f831d3941e2b6d20e80a74f7f67 Mon Sep 17 00:00:00 2001 From: Ayush Raj <58889205+AyushRajSharma@users.noreply.github.com> Date: Tue, 28 Apr 2020 01:14:22 +0530 Subject: [PATCH 2/3] Update .gitignore aadd --- .gitignore | 70 ------------------------------------------------------ 1 file changed, 70 deletions(-) diff --git a/.gitignore b/.gitignore index 47e0b4d6..8b137891 100644 --- a/.gitignore +++ b/.gitignore @@ -1,71 +1 @@ -# Miscellaneous -*.class -*.lock -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# Visual Studio Code related -.vscode/ - -# Flutter/Dart/Pub related -**/doc/api/ -.dart_tool/ -.flutter-plugins -.packages -.pub-cache/ -.pub/ -build/ - -# Android related -**/android/**/gradle-wrapper.jar -**/android/.gradle -**/android/captures/ -**/android/gradlew -**/android/gradlew.bat -**/android/local.properties -**/android/**/GeneratedPluginRegistrant.java - -# iOS/XCode related -**/ios/**/*.mode1v3 -**/ios/**/*.mode2v3 -**/ios/**/*.moved-aside -**/ios/**/*.pbxuser -**/ios/**/*.perspectivev3 -**/ios/**/*sync/ -**/ios/**/.sconsign.dblite -**/ios/**/.tags* -**/ios/**/.vagrant/ -**/ios/**/DerivedData/ -**/ios/**/Icon? -**/ios/**/Pods/ -**/ios/**/.symlinks/ -**/ios/**/profile -**/ios/**/xcuserdata -**/ios/.generated/ -**/ios/Flutter/App.framework -**/ios/Flutter/Flutter.framework -**/ios/Flutter/Generated.xcconfig -**/ios/Flutter/app.flx -**/ios/Flutter/app.zip -**/ios/Flutter/flutter_assets/ -**/ios/ServiceDefinitions.json -**/ios/Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!**/ios/**/default.mode1v3 -!**/ios/**/default.mode2v3 -!**/ios/**/default.pbxuser -!**/ios/**/default.perspectivev3 -!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages From 13d440240e3624317439076eb9cb10a3e5b6c61d Mon Sep 17 00:00:00 2001 From: Ayush Raj <58889205+AyushRajSharma@users.noreply.github.com> Date: Tue, 28 Apr 2020 01:25:59 +0530 Subject: [PATCH 3/3] added new file flutterdice --- lib/main.dart | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 6e68f204..b9475bc9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'dart:math'; void main() { return runApp( @@ -15,9 +16,49 @@ void main() { ); } -class DicePage extends StatelessWidget { +class DicePage extends StatefulWidget { + @override + _DicePageState createState() => _DicePageState(); +} + +class _DicePageState extends State { + int leftdicenumber = 1; + int rightdicenumber = 1; @override Widget build(BuildContext context) { - return Container(); + return Center( + child: Row( + children: [ + Expanded( + child: FlatButton( + onPressed: () { + setState(() { + leftdicenumber = Random().nextInt(6) + 1; + rightdicenumber = Random().nextInt(6) + 1; + }); + }, + child: Image.asset( + 'images/dice$leftdicenumber.png', + color: Colors.black, + ), + ), + ), + Expanded( + child: FlatButton( + onPressed: () { + setState(() { + rightdicenumber = Random().nextInt(6) + 1; + leftdicenumber = Random().nextInt(6) + 1; + }); + }, + child: Image.asset( + 'images/dice$rightdicenumber.png', + color: Colors.black, + ), + ), + ), + ], + ), + ); } }