@@ -67,16 +67,16 @@ class _CupertinoControlsState extends State<CupertinoControls>
6767 if (_latestValue.hasError) {
6868 return chewieController.errorBuilder != null
6969 ? chewieController.errorBuilder !(
70- context,
71- chewieController.videoPlayerController.value.errorDescription! ,
72- )
70+ context,
71+ chewieController.videoPlayerController.value.errorDescription! ,
72+ )
7373 : const Center (
74- child: Icon (
75- CupertinoIcons .exclamationmark_circle,
76- color: Colors .white,
77- size: 42 ,
78- ),
79- );
74+ child: Icon (
75+ CupertinoIcons .exclamationmark_circle,
76+ color: Colors .white,
77+ size: 42 ,
78+ ),
79+ );
8080 }
8181
8282 final backgroundColor = widget.backgroundColor;
@@ -172,12 +172,11 @@ class _CupertinoControlsState extends State<CupertinoControls>
172172 context: context,
173173 semanticsDismissible: true ,
174174 useRootNavigator: chewieController.useRootNavigator,
175- builder:
176- (context) => CupertinoOptionsDialog (
177- options: options,
178- cancelButtonText:
179- chewieController.optionsTranslation? .cancelButtonText,
180- ),
175+ builder: (context) => CupertinoOptionsDialog (
176+ options: options,
177+ cancelButtonText:
178+ chewieController.optionsTranslation? .cancelButtonText,
179+ ),
181180 );
182181 if (_latestValue.isPlaying) {
183182 _startHideTimer ();
@@ -252,37 +251,32 @@ class _CupertinoControlsState extends State<CupertinoControls>
252251 child: Container (
253252 height: barHeight,
254253 color: backgroundColor,
255- child:
256- chewieController.isLive
257- ? Row (
258- mainAxisAlignment: MainAxisAlignment .spaceBetween,
259- children: < Widget > [
260- _buildPlayPause (controller, iconColor, barHeight),
261- _buildLive (iconColor),
262- ],
263- )
264- : Row (
265- children: < Widget > [
266- _buildSkipBack (iconColor, barHeight),
267- _buildPlayPause (controller, iconColor, barHeight),
268- _buildSkipForward (iconColor, barHeight),
269- _buildPosition (iconColor),
270- _buildProgressBar (),
271- _buildRemaining (iconColor),
272- _buildSubtitleToggle (iconColor, barHeight),
273- if (chewieController.allowPlaybackSpeedChanging)
274- _buildSpeedButton (
275- controller,
276- iconColor,
277- barHeight,
278- ),
279- if (chewieController.additionalOptions != null &&
280- chewieController
281- .additionalOptions !(context)
282- .isNotEmpty)
283- _buildOptionsButton (iconColor, barHeight),
284- ],
285- ),
254+ child: chewieController.isLive
255+ ? Row (
256+ mainAxisAlignment: MainAxisAlignment .spaceBetween,
257+ children: < Widget > [
258+ _buildPlayPause (controller, iconColor, barHeight),
259+ _buildLive (iconColor),
260+ ],
261+ )
262+ : Row (
263+ children: < Widget > [
264+ _buildSkipBack (iconColor, barHeight),
265+ _buildPlayPause (controller, iconColor, barHeight),
266+ _buildSkipForward (iconColor, barHeight),
267+ _buildPosition (iconColor),
268+ _buildProgressBar (),
269+ _buildRemaining (iconColor),
270+ _buildSubtitleToggle (iconColor, barHeight),
271+ if (chewieController.allowPlaybackSpeedChanging)
272+ _buildSpeedButton (controller, iconColor, barHeight),
273+ if (chewieController.additionalOptions != null &&
274+ chewieController
275+ .additionalOptions !(context)
276+ .isNotEmpty)
277+ _buildOptionsButton (iconColor, barHeight),
278+ ],
279+ ),
286280 ),
287281 ),
288282 ),
@@ -344,24 +338,23 @@ class _CupertinoControlsState extends State<CupertinoControls>
344338 widget.showPlayButton && ! _latestValue.isPlaying && ! _dragging;
345339
346340 return GestureDetector (
347- onTap:
348- _latestValue.isPlaying
349- ? _chewieController? .pauseOnBackgroundTap ?? false
350- ? () {
341+ onTap: _latestValue.isPlaying
342+ ? _chewieController? .pauseOnBackgroundTap ?? false
343+ ? () {
351344 _playPause ();
352345
353346 setState (() {
354347 notifier.hideStuff = true ;
355348 });
356349 }
357- : _cancelAndRestartTimer
358- : () {
359- _hideTimer? .cancel ();
360-
361- setState (() {
362- notifier.hideStuff = false ;
363- });
364- },
350+ : _cancelAndRestartTimer
351+ : () {
352+ _hideTimer? .cancel ();
353+
354+ setState (() {
355+ notifier.hideStuff = false ;
356+ });
357+ },
365358 child: CenterPlayButton (
366359 backgroundColor: widget.backgroundColor,
367360 iconColor: widget.iconColor,
@@ -528,11 +521,10 @@ class _CupertinoControlsState extends State<CupertinoControls>
528521 context: context,
529522 semanticsDismissible: true ,
530523 useRootNavigator: chewieController.useRootNavigator,
531- builder:
532- (context) => _PlaybackSpeedDialog (
533- speeds: chewieController.playbackSpeeds,
534- selected: _latestValue.playbackSpeed,
535- ),
524+ builder: (context) => _PlaybackSpeedDialog (
525+ speeds: chewieController.playbackSpeeds,
526+ selected: _latestValue.playbackSpeed,
527+ ),
536528 );
537529
538530 if (chosenSpeed != null ) {
@@ -552,10 +544,9 @@ class _CupertinoControlsState extends State<CupertinoControls>
552544 margin: const EdgeInsets .only (right: 8.0 ),
553545 child: Transform (
554546 alignment: Alignment .center,
555- transform:
556- Matrix4 .skewY (0.0 )
557- ..rotateX (math.pi)
558- ..rotateZ (math.pi * 0.8 ),
547+ transform: Matrix4 .skewY (0.0 )
548+ ..rotateX (math.pi)
549+ ..rotateZ (math.pi * 0.8 ),
559550 child: Icon (Icons .speed, color: iconColor, size: 18.0 ),
560551 ),
561552 ),
@@ -733,10 +724,9 @@ class _CupertinoControlsState extends State<CupertinoControls>
733724 }
734725
735726 void _startHideTimer () {
736- final hideControlsTimer =
737- chewieController.hideControlsTimer.isNegative
738- ? ChewieController .defaultHideControlsTimer
739- : chewieController.hideControlsTimer;
727+ final hideControlsTimer = chewieController.hideControlsTimer.isNegative
728+ ? ChewieController .defaultHideControlsTimer
729+ : chewieController.hideControlsTimer;
740730 _hideTimer = Timer (hideControlsTimer, () {
741731 setState (() {
742732 notifier.hideStuff = true ;
@@ -794,24 +784,23 @@ class _PlaybackSpeedDialog extends StatelessWidget {
794784 final selectedColor = CupertinoTheme .of (context).primaryColor;
795785
796786 return CupertinoActionSheet (
797- actions:
798- _speeds
799- .map (
800- (e) => CupertinoActionSheetAction (
801- onPressed: () {
802- Navigator .of (context).pop (e);
803- },
804- child: Row (
805- mainAxisAlignment: MainAxisAlignment .center,
806- children: [
807- if (e == _selected)
808- Icon (Icons .check, size: 20.0 , color: selectedColor),
809- Text (e.toString ()),
810- ],
811- ),
812- ),
813- )
814- .toList (),
787+ actions: _speeds
788+ .map (
789+ (e) => CupertinoActionSheetAction (
790+ onPressed: () {
791+ Navigator .of (context).pop (e);
792+ },
793+ child: Row (
794+ mainAxisAlignment: MainAxisAlignment .center,
795+ children: [
796+ if (e == _selected)
797+ Icon (Icons .check, size: 20.0 , color: selectedColor),
798+ Text (e.toString ()),
799+ ],
800+ ),
801+ ),
802+ )
803+ .toList (),
815804 );
816805 }
817806}
0 commit comments