@@ -13,22 +13,20 @@ import 'package:provider/provider.dart';
1313import 'package:video_player/video_player.dart' ;
1414import 'package:wakelock_plus/wakelock_plus.dart' ;
1515
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+ );
2223
2324/// A Video Player with Material and Cupertino skins.
2425///
2526/// `video_player` is pretty low level. Chewie wraps it in a friendly skin to
2627/// make it easy to use!
2728class Chewie extends StatefulWidget {
28- const Chewie ({
29- super .key,
30- required this .controller,
31- });
29+ const Chewie ({super .key, required this .controller});
3230
3331 /// The [ChewieController]
3432 final ChewieController controller;
@@ -223,15 +221,13 @@ class ChewieState extends State<Chewie> {
223221 DeviceOrientation .landscapeRight,
224222 ]);
225223 }
226-
227224 /// Video h > w means we force portrait
228225 else if (isPortraitVideo) {
229226 SystemChrome .setPreferredOrientations ([
230227 DeviceOrientation .portraitUp,
231228 DeviceOrientation .portraitDown,
232229 ]);
233230 }
234-
235231 /// Otherwise if h == w (square video)
236232 else {
237233 SystemChrome .setPreferredOrientations (DeviceOrientation .values);
@@ -310,9 +306,9 @@ class ChewieController extends ChangeNotifier {
310306 this .controlsSafeAreaMinimum = EdgeInsets .zero,
311307 this .pauseOnBackgroundTap = false ,
312308 }) : 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+ ) {
316312 _initialize ();
317313 }
318314
@@ -365,7 +361,8 @@ class ChewieController extends ChangeNotifier {
365361 Animation <double >,
366362 Animation <double >,
367363 ChewieControllerProvider ,
368- )? routePageBuilder,
364+ )?
365+ routePageBuilder,
369366 bool ? pauseOnBackgroundTap,
370367 }) {
371368 return ChewieController (
@@ -409,14 +406,16 @@ class ChewieController extends ChangeNotifier {
409406 allowPlaybackSpeedChanging ?? this .allowPlaybackSpeedChanging,
410407 useRootNavigator: useRootNavigator ?? this .useRootNavigator,
411408 playbackSpeeds: playbackSpeeds ?? this .playbackSpeeds,
412- systemOverlaysOnEnterFullScreen: systemOverlaysOnEnterFullScreen ??
409+ systemOverlaysOnEnterFullScreen:
410+ systemOverlaysOnEnterFullScreen ??
413411 this .systemOverlaysOnEnterFullScreen,
414412 deviceOrientationsOnEnterFullScreen:
415413 deviceOrientationsOnEnterFullScreen ??
416- this .deviceOrientationsOnEnterFullScreen,
414+ this .deviceOrientationsOnEnterFullScreen,
417415 systemOverlaysAfterFullScreen:
418416 systemOverlaysAfterFullScreen ?? this .systemOverlaysAfterFullScreen,
419- deviceOrientationsAfterFullScreen: deviceOrientationsAfterFullScreen ??
417+ deviceOrientationsAfterFullScreen:
418+ deviceOrientationsAfterFullScreen ??
420419 this .deviceOrientationsAfterFullScreen,
421420 routePageBuilder: routePageBuilder ?? this .routePageBuilder,
422421 hideControlsTimer: hideControlsTimer ?? this .hideControlsTimer,
@@ -449,7 +448,8 @@ class ChewieController extends ChangeNotifier {
449448 final Future <void > Function (
450449 BuildContext context,
451450 List <OptionItem > chewieOptions,
452- )? optionsBuilder;
451+ )?
452+ optionsBuilder;
453453
454454 /// Add your own additional options on top of chewie options
455455 final List <OptionItem > Function (BuildContext context)? additionalOptions;
@@ -506,7 +506,7 @@ class ChewieController extends ChangeNotifier {
506506 /// When the video playback runs into an error, you can build a custom
507507 /// error message.
508508 final Widget Function (BuildContext context, String errorMessage)?
509- errorBuilder;
509+ errorBuilder;
510510
511511 /// When the video is buffering, you can build a custom widget.
512512 final WidgetBuilder ? bufferingBuilder;
0 commit comments