@@ -13,22 +13,20 @@ import 'package:provider/provider.dart';
13
13
import 'package:video_player/video_player.dart' ;
14
14
import 'package:wakelock_plus/wakelock_plus.dart' ;
15
15
16
- typedef ChewieRoutePageBuilder = Widget Function (
17
- BuildContext context,
18
- Animation <double > animation,
19
- Animation <double > secondaryAnimation,
20
- ChewieControllerProvider controllerProvider,
21
- );
16
+ typedef ChewieRoutePageBuilder =
17
+ Widget Function (
18
+ BuildContext context,
19
+ Animation <double > animation,
20
+ Animation <double > secondaryAnimation,
21
+ ChewieControllerProvider controllerProvider,
22
+ );
22
23
23
24
/// A Video Player with Material and Cupertino skins.
24
25
///
25
26
/// `video_player` is pretty low level. Chewie wraps it in a friendly skin to
26
27
/// make it easy to use!
27
28
class Chewie extends StatefulWidget {
28
- const Chewie ({
29
- super .key,
30
- required this .controller,
31
- });
29
+ const Chewie ({super .key, required this .controller});
32
30
33
31
/// The [ChewieController]
34
32
final ChewieController controller;
@@ -223,15 +221,13 @@ class ChewieState extends State<Chewie> {
223
221
DeviceOrientation .landscapeRight,
224
222
]);
225
223
}
226
-
227
224
/// Video h > w means we force portrait
228
225
else if (isPortraitVideo) {
229
226
SystemChrome .setPreferredOrientations ([
230
227
DeviceOrientation .portraitUp,
231
228
DeviceOrientation .portraitDown,
232
229
]);
233
230
}
234
-
235
231
/// Otherwise if h == w (square video)
236
232
else {
237
233
SystemChrome .setPreferredOrientations (DeviceOrientation .values);
@@ -310,9 +306,9 @@ class ChewieController extends ChangeNotifier {
310
306
this .controlsSafeAreaMinimum = EdgeInsets .zero,
311
307
this .pauseOnBackgroundTap = false ,
312
308
}) : assert (
313
- playbackSpeeds.every ((speed) => speed > 0 ),
314
- 'The playbackSpeeds values must all be greater than 0' ,
315
- ) {
309
+ playbackSpeeds.every ((speed) => speed > 0 ),
310
+ 'The playbackSpeeds values must all be greater than 0' ,
311
+ ) {
316
312
_initialize ();
317
313
}
318
314
@@ -365,7 +361,8 @@ class ChewieController extends ChangeNotifier {
365
361
Animation <double >,
366
362
Animation <double >,
367
363
ChewieControllerProvider ,
368
- )? routePageBuilder,
364
+ )?
365
+ routePageBuilder,
369
366
bool ? pauseOnBackgroundTap,
370
367
}) {
371
368
return ChewieController (
@@ -409,14 +406,16 @@ class ChewieController extends ChangeNotifier {
409
406
allowPlaybackSpeedChanging ?? this .allowPlaybackSpeedChanging,
410
407
useRootNavigator: useRootNavigator ?? this .useRootNavigator,
411
408
playbackSpeeds: playbackSpeeds ?? this .playbackSpeeds,
412
- systemOverlaysOnEnterFullScreen: systemOverlaysOnEnterFullScreen ??
409
+ systemOverlaysOnEnterFullScreen:
410
+ systemOverlaysOnEnterFullScreen ??
413
411
this .systemOverlaysOnEnterFullScreen,
414
412
deviceOrientationsOnEnterFullScreen:
415
413
deviceOrientationsOnEnterFullScreen ??
416
- this .deviceOrientationsOnEnterFullScreen,
414
+ this .deviceOrientationsOnEnterFullScreen,
417
415
systemOverlaysAfterFullScreen:
418
416
systemOverlaysAfterFullScreen ?? this .systemOverlaysAfterFullScreen,
419
- deviceOrientationsAfterFullScreen: deviceOrientationsAfterFullScreen ??
417
+ deviceOrientationsAfterFullScreen:
418
+ deviceOrientationsAfterFullScreen ??
420
419
this .deviceOrientationsAfterFullScreen,
421
420
routePageBuilder: routePageBuilder ?? this .routePageBuilder,
422
421
hideControlsTimer: hideControlsTimer ?? this .hideControlsTimer,
@@ -449,7 +448,8 @@ class ChewieController extends ChangeNotifier {
449
448
final Future <void > Function (
450
449
BuildContext context,
451
450
List <OptionItem > chewieOptions,
452
- )? optionsBuilder;
451
+ )?
452
+ optionsBuilder;
453
453
454
454
/// Add your own additional options on top of chewie options
455
455
final List <OptionItem > Function (BuildContext context)? additionalOptions;
@@ -506,7 +506,7 @@ class ChewieController extends ChangeNotifier {
506
506
/// When the video playback runs into an error, you can build a custom
507
507
/// error message.
508
508
final Widget Function (BuildContext context, String errorMessage)?
509
- errorBuilder;
509
+ errorBuilder;
510
510
511
511
/// When the video is buffering, you can build a custom widget.
512
512
final WidgetBuilder ? bufferingBuilder;
0 commit comments