Flutter - Dice

original

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void main() {
return runApp(
MaterialApp(
home: Scaffold(
backgroundColor: Colors.red,
appBar: AppBar(
title: Text('Dicee'),
backgroundColor: Colors.red,
),
body: DicePage(),
),
),
);
}

class DicePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container();
}
}

Using the Expanded Widget to Create Flexible Layouts

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
void main() {
return runApp(
MaterialApp(
home: Scaffold(
backgroundColor: Colors.red,
appBar: AppBar(
title: Text('Dicee'),
backgroundColor: Colors.red,
),
body: DicePage(),
),
),
);
}

class DicePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Row(
children: [
// kyp: expanded
Expanded(
// kyp: ratio
// flex:2,
// child: Image(
// image: AssetImage("images/dice1.png"),
// ),
// kyp: more simple
child: Image.asset("images/dice1.png"),
),
Expanded(
// flex:1,
child: Image.asset("images/dice1.png"),
),
],
);
}
}