@@ -12,24 +12,24 @@ class PlayerWithControls extends StatelessWidget {
12
12
Widget build (BuildContext context) {
13
13
final ChewieController chewieController = ChewieController .of (context);
14
14
15
- double _calculateAspectRatio (BuildContext context) {
15
+ double calculateAspectRatio (BuildContext context) {
16
16
final size = MediaQuery .of (context).size;
17
17
final width = size.width;
18
18
final height = size.height;
19
19
20
20
return width > height ? width / height : height / width;
21
21
}
22
22
23
- Widget _buildControls (
23
+ Widget buildControls (
24
24
BuildContext context,
25
25
ChewieController chewieController,
26
26
) {
27
27
return chewieController.showControls
28
28
? chewieController.customControls ?? const AdaptiveControls ()
29
- : Container ();
29
+ : const SizedBox ();
30
30
}
31
31
32
- Widget _buildPlayerWithControls (
32
+ Widget buildPlayerWithControls (
33
33
ChewieController chewieController,
34
34
BuildContext context,
35
35
) {
@@ -65,19 +65,19 @@ class PlayerWithControls extends StatelessWidget {
65
65
duration: const Duration (
66
66
milliseconds: 250 ,
67
67
),
68
- child: Container (
69
- decoration: const BoxDecoration (color: Colors .black54),
70
- child: Container (),
68
+ child: const DecoratedBox (
69
+ decoration: BoxDecoration (color: Colors .black54),
70
+ child: SizedBox (),
71
71
),
72
72
),
73
73
),
74
74
),
75
75
if (! chewieController.isFullScreen)
76
- _buildControls (context, chewieController)
76
+ buildControls (context, chewieController)
77
77
else
78
78
SafeArea (
79
79
bottom: false ,
80
- child: _buildControls (context, chewieController),
80
+ child: buildControls (context, chewieController),
81
81
),
82
82
],
83
83
);
@@ -88,8 +88,8 @@ class PlayerWithControls extends StatelessWidget {
88
88
height: MediaQuery .of (context).size.height,
89
89
width: MediaQuery .of (context).size.width,
90
90
child: AspectRatio (
91
- aspectRatio: _calculateAspectRatio (context),
92
- child: _buildPlayerWithControls (chewieController, context),
91
+ aspectRatio: calculateAspectRatio (context),
92
+ child: buildPlayerWithControls (chewieController, context),
93
93
),
94
94
),
95
95
);
0 commit comments