@@ -67,16 +67,16 @@ class _CupertinoControlsState extends State<CupertinoControls>
67
67
if (_latestValue.hasError) {
68
68
return chewieController.errorBuilder != null
69
69
? chewieController.errorBuilder !(
70
- context,
71
- chewieController.videoPlayerController.value.errorDescription! ,
72
- )
70
+ context,
71
+ chewieController.videoPlayerController.value.errorDescription! ,
72
+ )
73
73
: 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
+ );
80
80
}
81
81
82
82
final backgroundColor = widget.backgroundColor;
@@ -172,12 +172,11 @@ class _CupertinoControlsState extends State<CupertinoControls>
172
172
context: context,
173
173
semanticsDismissible: true ,
174
174
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
+ ),
181
180
);
182
181
if (_latestValue.isPlaying) {
183
182
_startHideTimer ();
@@ -252,37 +251,32 @@ class _CupertinoControlsState extends State<CupertinoControls>
252
251
child: Container (
253
252
height: barHeight,
254
253
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
+ ),
286
280
),
287
281
),
288
282
),
@@ -344,24 +338,23 @@ class _CupertinoControlsState extends State<CupertinoControls>
344
338
widget.showPlayButton && ! _latestValue.isPlaying && ! _dragging;
345
339
346
340
return GestureDetector (
347
- onTap:
348
- _latestValue.isPlaying
349
- ? _chewieController? .pauseOnBackgroundTap ?? false
350
- ? () {
341
+ onTap: _latestValue.isPlaying
342
+ ? _chewieController? .pauseOnBackgroundTap ?? false
343
+ ? () {
351
344
_playPause ();
352
345
353
346
setState (() {
354
347
notifier.hideStuff = true ;
355
348
});
356
349
}
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
+ },
365
358
child: CenterPlayButton (
366
359
backgroundColor: widget.backgroundColor,
367
360
iconColor: widget.iconColor,
@@ -528,11 +521,10 @@ class _CupertinoControlsState extends State<CupertinoControls>
528
521
context: context,
529
522
semanticsDismissible: true ,
530
523
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
+ ),
536
528
);
537
529
538
530
if (chosenSpeed != null ) {
@@ -552,10 +544,9 @@ class _CupertinoControlsState extends State<CupertinoControls>
552
544
margin: const EdgeInsets .only (right: 8.0 ),
553
545
child: Transform (
554
546
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 ),
559
550
child: Icon (Icons .speed, color: iconColor, size: 18.0 ),
560
551
),
561
552
),
@@ -733,10 +724,9 @@ class _CupertinoControlsState extends State<CupertinoControls>
733
724
}
734
725
735
726
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;
740
730
_hideTimer = Timer (hideControlsTimer, () {
741
731
setState (() {
742
732
notifier.hideStuff = true ;
@@ -794,24 +784,23 @@ class _PlaybackSpeedDialog extends StatelessWidget {
794
784
final selectedColor = CupertinoTheme .of (context).primaryColor;
795
785
796
786
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 (),
815
804
);
816
805
}
817
806
}
0 commit comments