New version
This commit is contained in:
parent
421f982ae2
commit
9da11e48de
13
ios/Flutter/flutter_export_environment.sh
Normal file
13
ios/Flutter/flutter_export_environment.sh
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# This is a generated file; do not edit or check into version control.
|
||||||
|
export "FLUTTER_ROOT=D:\flutter\flutter"
|
||||||
|
export "FLUTTER_APPLICATION_PATH=D:\Projects\dicee-flutter"
|
||||||
|
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
|
||||||
|
export "FLUTTER_TARGET=lib\main.dart"
|
||||||
|
export "FLUTTER_BUILD_DIR=build"
|
||||||
|
export "FLUTTER_BUILD_NAME=1.0.0"
|
||||||
|
export "FLUTTER_BUILD_NUMBER=1"
|
||||||
|
export "DART_OBFUSCATION=false"
|
||||||
|
export "TRACK_WIDGET_CREATION=false"
|
||||||
|
export "TREE_SHAKE_ICONS=false"
|
||||||
|
export "PACKAGE_CONFIG=.packages"
|
@ -1,3 +1,5 @@
|
|||||||
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
@ -6,6 +8,7 @@ void main() {
|
|||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
backgroundColor: Colors.red,
|
backgroundColor: Colors.red,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
centerTitle: true,
|
||||||
title: Text('Dicee'),
|
title: Text('Dicee'),
|
||||||
backgroundColor: Colors.red,
|
backgroundColor: Colors.red,
|
||||||
),
|
),
|
||||||
@ -15,9 +18,48 @@ void main() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class DicePage extends StatelessWidget {
|
class DicePage extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_DicePageState createState() => _DicePageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DicePageState extends State<DicePage> {
|
||||||
|
int leftDiceNumber = 1, rightDiceNumber = 1;
|
||||||
|
int randomNumb() {
|
||||||
|
int a = 1 + Random().nextInt(6);
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
|
void changeNumb() {
|
||||||
|
setState(() {
|
||||||
|
leftDiceNumber = randomNumb();
|
||||||
|
rightDiceNumber = randomNumb();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container();
|
return Center(
|
||||||
|
child: Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
changeNumb();
|
||||||
|
},
|
||||||
|
child: Image.asset('images/dice$leftDiceNumber.png'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
changeNumb();
|
||||||
|
},
|
||||||
|
child: Image.asset('images/dice$rightDiceNumber.png'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user