@@ -44,12 +44,14 @@ class DirectionController extends StatelessWidget {
44
44
_Button (
45
45
enableLongPress: false ,
46
46
size: _DIRECTION_BUTTON_SIZE ,
47
+ buttonIcon: Icons .rotate_right,
47
48
onTap: () {
48
49
Game .of (context).rotate ();
49
50
}),
50
51
SizedBox (width: _DIRECTION_SPACE ),
51
52
_Button (
52
53
size: _DIRECTION_BUTTON_SIZE ,
54
+ buttonIcon: Icons .chevron_right,
53
55
onTap: () {
54
56
Game .of (context).right ();
55
57
}),
@@ -61,12 +63,14 @@ class DirectionController extends StatelessWidget {
61
63
children: < Widget > [
62
64
_Button (
63
65
size: _DIRECTION_BUTTON_SIZE ,
66
+ buttonIcon: Icons .chevron_left,
64
67
onTap: () {
65
68
Game .of (context).left ();
66
69
}),
67
70
SizedBox (width: _DIRECTION_SPACE ),
68
71
_Button (
69
72
size: _DIRECTION_BUTTON_SIZE ,
73
+ buttonIcon: Icons .keyboard_arrow_down,
70
74
onTap: () {
71
75
Game .of (context).down ();
72
76
},
@@ -118,6 +122,7 @@ class DropButton extends StatelessWidget {
118
122
return _Button (
119
123
enableLongPress: false ,
120
124
size: Size (90 , 90 ),
125
+ buttonIcon: Icons .file_download,
121
126
onTap: () {
122
127
Game .of (context).drop ();
123
128
});
@@ -178,6 +183,7 @@ class _SystemButton extends StatelessWidget {
178
183
179
184
class _Button extends StatefulWidget {
180
185
final Size size;
186
+ final IconData buttonIcon;
181
187
182
188
final VoidCallback onTap;
183
189
@@ -190,6 +196,7 @@ class _Button extends StatefulWidget {
190
196
{Key key,
191
197
@required this .size,
192
198
@required this .onTap,
199
+ @required this .buttonIcon,
193
200
this .color = Colors .blue,
194
201
this .enableLongPress = true })
195
202
: super (key: key);
@@ -268,7 +275,14 @@ class _ButtonState extends State<_Button> {
268
275
_color = widget.color;
269
276
});
270
277
},
271
- child: SizedBox .fromSize (size: widget.size),
278
+ child: SizedBox .fromSize (
279
+ size: widget.size,
280
+ child: Transform .rotate (angle: (widget.buttonIcon == Icons .file_download) ? 0 : - (math.pi/ 12.0 ) * 3 ,
281
+ child: Icon (
282
+ widget.buttonIcon,
283
+ color: Colors .white),
284
+ ),
285
+ ),
272
286
),
273
287
);
274
288
}
0 commit comments