11import 'package:flutter/material.dart' ;
2+
23import 'package:flutter_vlc_player/flutter_vlc_player.dart' ;
34
45class ControlsOverlay extends StatelessWidget {
5- const ControlsOverlay ({Key key, this .controller}) : super (key: key);
6-
7- final VlcPlayerController controller;
8-
96 static const double _playButtonIconSize = 80 ;
107 static const double _replayButtonIconSize = 100 ;
118 static const double _seekButtonIconSize = 48 ;
@@ -15,11 +12,15 @@ class ControlsOverlay extends StatelessWidget {
1512
1613 static const Color _iconColor = Colors .white;
1714
15+ final VlcPlayerController controller;
16+
17+ const ControlsOverlay ({Key key, this .controller}) : super (key: key);
18+
1819 @override
1920 Widget build (BuildContext context) {
2021 return AnimatedSwitcher (
21- duration: Duration (milliseconds: 50 ),
22- reverseDuration: Duration (milliseconds: 200 ),
22+ duration: const Duration (milliseconds: 50 ),
23+ reverseDuration: const Duration (milliseconds: 200 ),
2324 child: Builder (
2425 builder: (ctx) {
2526 if (controller.value.isEnded || controller.value.hasError) {
@@ -29,7 +30,7 @@ class ControlsOverlay extends StatelessWidget {
2930 onPressed: _replay,
3031 color: _iconColor,
3132 iconSize: _replayButtonIconSize,
32- icon: Icon (Icons .replay),
33+ icon: const Icon (Icons .replay),
3334 ),
3435 ),
3536 );
@@ -40,7 +41,7 @@ class ControlsOverlay extends StatelessWidget {
4041 case PlayingState .stopped:
4142 case PlayingState .paused:
4243 return SizedBox .expand (
43- child: Container (
44+ child: ColoredBox (
4445 color: Colors .black45,
4546 child: FittedBox (
4647 child: Row (
@@ -51,19 +52,19 @@ class ControlsOverlay extends StatelessWidget {
5152 onPressed: () => _seekRelative (_seekStepBackward),
5253 color: _iconColor,
5354 iconSize: _seekButtonIconSize,
54- icon: Icon (Icons .replay_10),
55+ icon: const Icon (Icons .replay_10),
5556 ),
5657 IconButton (
5758 onPressed: _play,
5859 color: _iconColor,
5960 iconSize: _playButtonIconSize,
60- icon: Icon (Icons .play_arrow),
61+ icon: const Icon (Icons .play_arrow),
6162 ),
6263 IconButton (
6364 onPressed: () => _seekRelative (_seekStepForward),
6465 color: _iconColor,
6566 iconSize: _seekButtonIconSize,
66- icon: Icon (Icons .forward_10),
67+ icon: const Icon (Icons .forward_10),
6768 ),
6869 ],
6970 ),
@@ -88,13 +89,13 @@ class ControlsOverlay extends StatelessWidget {
8889 onPressed: _replay,
8990 color: _iconColor,
9091 iconSize: _replayButtonIconSize,
91- icon: Icon (Icons .replay),
92+ icon: const Icon (Icons .replay),
9293 ),
9394 ),
9495 );
9596
9697 default :
97- return SizedBox .shrink ();
98+ return const SizedBox .shrink ();
9899 }
99100 },
100101 ),
0 commit comments