Skip to content

Commit 4da460a

Browse files
committed
reverted formatting
1 parent ade5079 commit 4da460a

File tree

1 file changed

+47
-22
lines changed

1 file changed

+47
-22
lines changed

lib/src/material/material_desktop_controls.dart

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ class MaterialDesktopControls extends StatefulWidget {
3131
}
3232
}
3333

34-
class _MaterialDesktopControlsState extends State<MaterialDesktopControls> with SingleTickerProviderStateMixin {
34+
class _MaterialDesktopControlsState extends State<MaterialDesktopControls>
35+
with SingleTickerProviderStateMixin {
3536
late PlayerNotifier notifier;
3637
late VideoPlayerValue _latestValue;
3738
double? _latestVolume;
@@ -66,11 +67,14 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls> with
6667
void _handleKeyPress(event) {
6768
if (event is KeyDownEvent && event.logicalKey == LogicalKeyboardKey.space) {
6869
_playPause();
69-
} else if (event is KeyDownEvent && event.logicalKey == LogicalKeyboardKey.arrowRight) {
70+
} else if (event is KeyDownEvent &&
71+
event.logicalKey == LogicalKeyboardKey.arrowRight) {
7072
_seekForward();
71-
} else if (event is KeyDownEvent && event.logicalKey == LogicalKeyboardKey.arrowLeft) {
73+
} else if (event is KeyDownEvent &&
74+
event.logicalKey == LogicalKeyboardKey.arrowLeft) {
7275
_seekBackward();
73-
} else if (event is KeyDownEvent && event.logicalKey == LogicalKeyboardKey.escape) {
76+
} else if (event is KeyDownEvent &&
77+
event.logicalKey == LogicalKeyboardKey.escape) {
7478
if (chewieController.isFullScreen) {
7579
_onExpandCollapse();
7680
}
@@ -123,7 +127,8 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls> with
123127
0.0,
124128
notifier.hideStuff ? barHeight * 0.8 : 0.0,
125129
),
126-
child: _buildSubtitles(context, chewieController.subtitle!),
130+
child: _buildSubtitles(
131+
context, chewieController.subtitle!),
127132
),
128133
_buildBottomBar(context),
129134
],
@@ -183,11 +188,13 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls> with
183188
_onSpeedButtonTap();
184189
},
185190
iconData: Icons.speed,
186-
title: chewieController.optionsTranslation?.playbackSpeedButtonText ?? 'Playback speed',
191+
title: chewieController.optionsTranslation?.playbackSpeedButtonText ??
192+
'Playback speed',
187193
)
188194
];
189195

190-
if (chewieController.additionalOptions != null && chewieController.additionalOptions!(context).isNotEmpty) {
196+
if (chewieController.additionalOptions != null &&
197+
chewieController.additionalOptions!(context).isNotEmpty) {
191198
options.addAll(chewieController.additionalOptions!(context));
192199
}
193200

@@ -208,7 +215,8 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls> with
208215
useRootNavigator: chewieController.useRootNavigator,
209216
builder: (context) => OptionsDialog(
210217
options: options,
211-
cancelButtonText: chewieController.optionsTranslation?.cancelButtonText,
218+
cancelButtonText:
219+
chewieController.optionsTranslation?.cancelButtonText,
212220
),
213221
);
214222
}
@@ -270,7 +278,8 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls> with
270278
duration: const Duration(milliseconds: 300),
271279
child: Container(
272280
height: barHeight + (chewieController.isFullScreen ? 20.0 : 0),
273-
padding: EdgeInsets.only(bottom: chewieController.isFullScreen ? 10.0 : 15),
281+
padding:
282+
EdgeInsets.only(bottom: chewieController.isFullScreen ? 10.0 : 15),
274283
child: SafeArea(
275284
bottom: chewieController.isFullScreen,
276285
child: Column(
@@ -282,12 +291,19 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls> with
282291
child: Row(
283292
children: <Widget>[
284293
_buildPlayPause(controller),
285-
if (chewieController.allowMuting) _buildMuteButton(controller),
286-
if (chewieController.isLive) const Expanded(child: Text('LIVE')) else _buildPosition(iconColor),
294+
if (chewieController.allowMuting)
295+
_buildMuteButton(controller),
296+
if (chewieController.isLive)
297+
const Expanded(child: Text('LIVE'))
298+
else
299+
_buildPosition(iconColor),
287300
const Spacer(),
288-
if (chewieController.showControls && chewieController.subtitle != null && chewieController.subtitle!.isNotEmpty)
301+
if (chewieController.showControls &&
302+
chewieController.subtitle != null &&
303+
chewieController.subtitle!.isNotEmpty)
289304
_buildSubtitleToggle(icon: Icons.subtitles),
290-
if (chewieController.showOptions) _buildOptionsButton(icon: Icons.settings),
305+
if (chewieController.showOptions)
306+
_buildOptionsButton(icon: Icons.settings),
291307
if (chewieController.allowFullScreen) _buildExpandButton(),
292308
],
293309
),
@@ -329,7 +345,9 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls> with
329345
),
330346
child: Center(
331347
child: Icon(
332-
chewieController.isFullScreen ? Icons.fullscreen_exit : Icons.fullscreen,
348+
chewieController.isFullScreen
349+
? Icons.fullscreen_exit
350+
: Icons.fullscreen,
333351
color: Colors.white,
334352
),
335353
),
@@ -339,8 +357,10 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls> with
339357
}
340358

341359
Widget _buildHitArea() {
342-
final bool isFinished = _latestValue.position >= _latestValue.duration && _latestValue.duration.inSeconds > 0;
343-
final bool showPlayButton = widget.showPlayButton && !_dragging && !notifier.hideStuff;
360+
final bool isFinished = _latestValue.position >= _latestValue.duration &&
361+
_latestValue.duration.inSeconds > 0;
362+
final bool showPlayButton =
363+
widget.showPlayButton && !_dragging && !notifier.hideStuff;
344364

345365
return GestureDetector(
346366
onTap: () {
@@ -475,7 +495,8 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls> with
475495
}
476496

477497
Future<void> _initialize() async {
478-
_subtitleOn = chewieController.showSubtitles && (chewieController.subtitle?.isNotEmpty ?? false);
498+
_subtitleOn = chewieController.showSubtitles &&
499+
(chewieController.subtitle?.isNotEmpty ?? false);
479500
controller.addListener(_updateState);
480501

481502
_updateState();
@@ -500,7 +521,8 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls> with
500521

501522
chewieController.toggleFullScreen();
502523

503-
_showAfterExpandCollapseTimer = Timer(const Duration(milliseconds: 300), () {
524+
_showAfterExpandCollapseTimer =
525+
Timer(const Duration(milliseconds: 300), () {
504526
setState(() {
505527
_cancelAndRestartTimer();
506528
});
@@ -531,8 +553,9 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls> with
531553
}
532554

533555
void _startHideTimer() {
534-
final hideControlsTimer =
535-
chewieController.hideControlsTimer.isNegative ? ChewieController.defaultHideControlsTimer : chewieController.hideControlsTimer;
556+
final hideControlsTimer = chewieController.hideControlsTimer.isNegative
557+
? ChewieController.defaultHideControlsTimer
558+
: chewieController.hideControlsTimer;
536559
_hideTimer = Timer(hideControlsTimer, () {
537560
setState(() {
538561
notifier.hideStuff = true;
@@ -627,8 +650,10 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls> with
627650
ChewieProgressColors(
628651
playedColor: Theme.of(context).colorScheme.secondary,
629652
handleColor: Theme.of(context).colorScheme.secondary,
630-
bufferedColor: Theme.of(context).colorScheme.surface.withOpacityCompat(0.5),
631-
backgroundColor: Theme.of(context).disabledColor.withOpacityCompat(0.5),
653+
bufferedColor:
654+
Theme.of(context).colorScheme.surface.withOpacityCompat(0.5),
655+
backgroundColor:
656+
Theme.of(context).disabledColor.withOpacityCompat(0.5),
632657
),
633658
draggableProgressBar: chewieController.draggableProgressBar,
634659
),

0 commit comments

Comments
 (0)