@@ -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;
@@ -237,15 +235,13 @@ class ChewieState extends State<Chewie> {
237235 DeviceOrientation .landscapeRight,
238236 ]);
239237 }
240-
241238 /// Video h > w means we force portrait
242239 else if (isPortraitVideo) {
243240 SystemChrome .setPreferredOrientations ([
244241 DeviceOrientation .portraitUp,
245242 DeviceOrientation .portraitDown,
246243 ]);
247244 }
248-
249245 /// Otherwise if h == w (square video)
250246 else {
251247 SystemChrome .setPreferredOrientations (DeviceOrientation .values);
@@ -324,9 +320,9 @@ class ChewieController extends ChangeNotifier {
324320 this .controlsSafeAreaMinimum = EdgeInsets .zero,
325321 this .pauseOnBackgroundTap = false ,
326322 }) : assert (
327- playbackSpeeds.every ((speed) => speed > 0 ),
328- 'The playbackSpeeds values must all be greater than 0' ,
329- ) {
323+ playbackSpeeds.every ((speed) => speed > 0 ),
324+ 'The playbackSpeeds values must all be greater than 0' ,
325+ ) {
330326 _initialize ();
331327 }
332328
@@ -379,7 +375,8 @@ class ChewieController extends ChangeNotifier {
379375 Animation <double >,
380376 Animation <double >,
381377 ChewieControllerProvider ,
382- )? routePageBuilder,
378+ )?
379+ routePageBuilder,
383380 bool ? pauseOnBackgroundTap,
384381 }) {
385382 return ChewieController (
@@ -423,14 +420,16 @@ class ChewieController extends ChangeNotifier {
423420 allowPlaybackSpeedChanging ?? this .allowPlaybackSpeedChanging,
424421 useRootNavigator: useRootNavigator ?? this .useRootNavigator,
425422 playbackSpeeds: playbackSpeeds ?? this .playbackSpeeds,
426- systemOverlaysOnEnterFullScreen: systemOverlaysOnEnterFullScreen ??
423+ systemOverlaysOnEnterFullScreen:
424+ systemOverlaysOnEnterFullScreen ??
427425 this .systemOverlaysOnEnterFullScreen,
428426 deviceOrientationsOnEnterFullScreen:
429427 deviceOrientationsOnEnterFullScreen ??
430- this .deviceOrientationsOnEnterFullScreen,
428+ this .deviceOrientationsOnEnterFullScreen,
431429 systemOverlaysAfterFullScreen:
432430 systemOverlaysAfterFullScreen ?? this .systemOverlaysAfterFullScreen,
433- deviceOrientationsAfterFullScreen: deviceOrientationsAfterFullScreen ??
431+ deviceOrientationsAfterFullScreen:
432+ deviceOrientationsAfterFullScreen ??
434433 this .deviceOrientationsAfterFullScreen,
435434 routePageBuilder: routePageBuilder ?? this .routePageBuilder,
436435 hideControlsTimer: hideControlsTimer ?? this .hideControlsTimer,
@@ -463,7 +462,8 @@ class ChewieController extends ChangeNotifier {
463462 final Future <void > Function (
464463 BuildContext context,
465464 List <OptionItem > chewieOptions,
466- )? optionsBuilder;
465+ )?
466+ optionsBuilder;
467467
468468 /// Add your own additional options on top of chewie options
469469 final List <OptionItem > Function (BuildContext context)? additionalOptions;
@@ -520,7 +520,7 @@ class ChewieController extends ChangeNotifier {
520520 /// When the video playback runs into an error, you can build a custom
521521 /// error message.
522522 final Widget Function (BuildContext context, String errorMessage)?
523- errorBuilder;
523+ errorBuilder;
524524
525525 /// When the video is buffering, you can build a custom widget.
526526 final WidgetBuilder ? bufferingBuilder;
0 commit comments