File tree Expand file tree Collapse file tree 6 files changed +16
-17
lines changed Expand file tree Collapse file tree 6 files changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -21,14 +21,14 @@ class CenterPlayButton extends StatelessWidget {
21
21
22
22
@override
23
23
Widget build (BuildContext context) {
24
- return Container (
24
+ return ColoredBox (
25
25
color: Colors .transparent,
26
26
child: Center (
27
27
child: UnconstrainedBox (
28
28
child: AnimatedOpacity (
29
29
opacity: show ? 1.0 : 0.0 ,
30
30
duration: const Duration (milliseconds: 300 ),
31
- child: Container (
31
+ child: DecoratedBox (
32
32
decoration: BoxDecoration (
33
33
color: backgroundColor,
34
34
shape: BoxShape .circle,
Original file line number Diff line number Diff line change @@ -203,14 +203,14 @@ class _CupertinoControlsState extends State<CupertinoControls>
203
203
204
204
Widget _buildSubtitles (Subtitles subtitles) {
205
205
if (! _subtitleOn) {
206
- return Container ();
206
+ return const SizedBox ();
207
207
}
208
208
if (_subtitlesPosition == null ) {
209
- return Container ();
209
+ return const SizedBox ();
210
210
}
211
211
final currentSubtitle = subtitles.getByPosition (_subtitlesPosition! );
212
212
if (currentSubtitle.isEmpty) {
213
- return Container ();
213
+ return const SizedBox ();
214
214
}
215
215
216
216
if (chewieController.subtitleBuilder != null ) {
@@ -395,7 +395,7 @@ class _CupertinoControlsState extends State<CupertinoControls>
395
395
borderRadius: BorderRadius .circular (10.0 ),
396
396
child: BackdropFilter (
397
397
filter: ui.ImageFilter .blur (sigmaX: 10.0 ),
398
- child: Container (
398
+ child: ColoredBox (
399
399
color: backgroundColor,
400
400
child: Container (
401
401
height: barHeight,
@@ -468,7 +468,7 @@ class _CupertinoControlsState extends State<CupertinoControls>
468
468
Widget _buildSubtitleToggle (Color iconColor, double barHeight) {
469
469
//if don't have subtitle hiden button
470
470
if (chewieController.subtitle? .isEmpty ?? true ) {
471
- return Container ();
471
+ return const SizedBox ();
472
472
}
473
473
return GestureDetector (
474
474
onTap: _subtitleToggle,
Original file line number Diff line number Diff line change 1
1
import 'package:chewie/chewie.dart' ;
2
- import 'package:chewie/src/material/material_desktop_controls.dart' ;
3
2
import 'package:flutter/material.dart' ;
4
3
5
4
class AdaptiveControls extends StatelessWidget {
Original file line number Diff line number Diff line change @@ -213,11 +213,11 @@ class _MaterialControlsState extends State<MaterialControls>
213
213
214
214
Widget _buildSubtitles (BuildContext context, Subtitles subtitles) {
215
215
if (! _subtitleOn) {
216
- return Container ();
216
+ return const SizedBox ();
217
217
}
218
218
final currentSubtitle = subtitles.getByPosition (_subtitlesPosition);
219
219
if (currentSubtitle.isEmpty) {
220
- return Container ();
220
+ return const SizedBox ();
221
221
}
222
222
223
223
if (chewieController.subtitleBuilder != null ) {
@@ -446,7 +446,7 @@ class _MaterialControlsState extends State<MaterialControls>
446
446
Widget _buildSubtitleToggle () {
447
447
//if don't have subtitle hiden button
448
448
if (chewieController.subtitle? .isEmpty ?? true ) {
449
- return Container ();
449
+ return const SizedBox ();
450
450
}
451
451
return GestureDetector (
452
452
onTap: _onSubtitleTap,
Original file line number Diff line number Diff line change @@ -206,11 +206,11 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls>
206
206
207
207
Widget _buildSubtitles (BuildContext context, Subtitles subtitles) {
208
208
if (! _subtitleOn) {
209
- return Container ();
209
+ return const SizedBox ();
210
210
}
211
211
final currentSubtitle = subtitles.getByPosition (_subtitlesPosition);
212
212
if (currentSubtitle.isEmpty) {
213
- return Container ();
213
+ return const SizedBox ();
214
214
}
215
215
216
216
if (chewieController.subtitleBuilder != null ) {
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ class PlayerWithControls extends StatelessWidget {
26
26
) {
27
27
return chewieController.showControls
28
28
? chewieController.customControls ?? const AdaptiveControls ()
29
- : Container ();
29
+ : const SizedBox ();
30
30
}
31
31
32
32
Widget _buildPlayerWithControls (
@@ -65,9 +65,9 @@ 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
),
You can’t perform that action at this time.
0 commit comments