@@ -24,27 +24,29 @@ class CenterPlayButton extends StatelessWidget {
24
24
return Container (
25
25
color: Colors .transparent,
26
26
child: Center (
27
- child: AnimatedOpacity (
28
- opacity: show ? 1.0 : 0.0 ,
29
- duration: const Duration (milliseconds: 300 ),
30
- child: Container (
31
- decoration: BoxDecoration (
32
- color: backgroundColor,
33
- shape: BoxShape .circle,
34
- ),
35
- child: Padding (
36
- padding: const EdgeInsets .all (12.0 ),
37
- // Always set the iconSize on the IconButton, not on the Icon itself:
38
- // https://github.com/flutter/flutter/issues/52980
39
- child: IconButton (
40
- iconSize: 32 ,
41
- icon: isFinished
42
- ? Icon (Icons .replay, color: iconColor)
43
- : AnimatedPlayPause (
44
- color: iconColor,
45
- playing: isPlaying,
46
- ),
47
- onPressed: onPressed,
27
+ child: UnconstrainedBox (
28
+ child: AnimatedOpacity (
29
+ opacity: show ? 1.0 : 0.0 ,
30
+ duration: const Duration (milliseconds: 300 ),
31
+ child: Container (
32
+ decoration: BoxDecoration (
33
+ color: backgroundColor,
34
+ shape: BoxShape .circle,
35
+ ),
36
+ child: Padding (
37
+ padding: const EdgeInsets .all (12.0 ),
38
+ // Always set the iconSize on the IconButton, not on the Icon itself:
39
+ // https://github.com/flutter/flutter/issues/52980
40
+ child: IconButton (
41
+ iconSize: 32 ,
42
+ icon: isFinished
43
+ ? Icon (Icons .replay, color: iconColor)
44
+ : AnimatedPlayPause (
45
+ color: iconColor,
46
+ playing: isPlaying,
47
+ ),
48
+ onPressed: onPressed,
49
+ ),
48
50
),
49
51
),
50
52
),
0 commit comments