@@ -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 (
@@ -415,14 +412,16 @@ class ChewieController extends ChangeNotifier {
415412 allowPlaybackSpeedChanging ?? this .allowPlaybackSpeedChanging,
416413 useRootNavigator: useRootNavigator ?? this .useRootNavigator,
417414 playbackSpeeds: playbackSpeeds ?? this .playbackSpeeds,
418- systemOverlaysOnEnterFullScreen: systemOverlaysOnEnterFullScreen ??
415+ systemOverlaysOnEnterFullScreen:
416+ systemOverlaysOnEnterFullScreen ??
419417 this .systemOverlaysOnEnterFullScreen,
420418 deviceOrientationsOnEnterFullScreen:
421419 deviceOrientationsOnEnterFullScreen ??
422- this .deviceOrientationsOnEnterFullScreen,
420+ this .deviceOrientationsOnEnterFullScreen,
423421 systemOverlaysAfterFullScreen:
424422 systemOverlaysAfterFullScreen ?? this .systemOverlaysAfterFullScreen,
425- deviceOrientationsAfterFullScreen: deviceOrientationsAfterFullScreen ??
423+ deviceOrientationsAfterFullScreen:
424+ deviceOrientationsAfterFullScreen ??
426425 this .deviceOrientationsAfterFullScreen,
427426 routePageBuilder: routePageBuilder ?? this .routePageBuilder,
428427 hideControlsTimer: hideControlsTimer ?? this .hideControlsTimer,
@@ -455,7 +454,8 @@ class ChewieController extends ChangeNotifier {
455454 final Future <void > Function (
456455 BuildContext context,
457456 List <OptionItem > chewieOptions,
458- )? optionsBuilder;
457+ )?
458+ optionsBuilder;
459459
460460 /// Add your own additional options on top of chewie options
461461 final List <OptionItem > Function (BuildContext context)? additionalOptions;
@@ -516,7 +516,7 @@ class ChewieController extends ChangeNotifier {
516516 /// When the video playback runs into an error, you can build a custom
517517 /// error message.
518518 final Widget Function (BuildContext context, String errorMessage)?
519- errorBuilder;
519+ errorBuilder;
520520
521521 /// When the video is buffering, you can build a custom widget.
522522 final WidgetBuilder ? bufferingBuilder;
0 commit comments