@@ -63,15 +63,15 @@ class VideoPlayerValue {
6363
6464 /// Returns an instance for a video that hasn't been loaded.
6565 const VideoPlayerValue .uninitialized ()
66- : this (duration: Duration .zero, isInitialized: false );
66+ : this (duration: Duration .zero, isInitialized: false );
6767
6868 /// Returns an instance with the given [errorDescription] .
6969 const VideoPlayerValue .erroneous (String errorDescription)
70- : this (
71- duration: Duration .zero,
72- isInitialized: false ,
73- errorDescription: errorDescription,
74- );
70+ : this (
71+ duration: Duration .zero,
72+ isInitialized: false ,
73+ errorDescription: errorDescription,
74+ );
7575
7676 /// This constant is just to indicate that parameter is not passed to [copyWith]
7777 /// workaround for this issue https://github.com/dart-lang/language/issues/2009
@@ -188,10 +188,9 @@ class VideoPlayerValue {
188188 volume: volume ?? this .volume,
189189 playbackSpeed: playbackSpeed ?? this .playbackSpeed,
190190 rotationCorrection: rotationCorrection ?? this .rotationCorrection,
191- errorDescription:
192- errorDescription != _defaultErrorDescription
193- ? errorDescription
194- : this .errorDescription,
191+ errorDescription: errorDescription != _defaultErrorDescription
192+ ? errorDescription
193+ : this .errorDescription,
195194 isCompleted: isCompleted ?? this .isCompleted,
196195 );
197196 }
@@ -238,22 +237,22 @@ class VideoPlayerValue {
238237
239238 @override
240239 int get hashCode => Object .hash (
241- duration,
242- position,
243- caption,
244- captionOffset,
245- buffered,
246- isPlaying,
247- isLooping,
248- isBuffering,
249- volume,
250- playbackSpeed,
251- errorDescription,
252- size,
253- rotationCorrection,
254- isInitialized,
255- isCompleted,
256- );
240+ duration,
241+ position,
242+ caption,
243+ captionOffset,
244+ buffered,
245+ isPlaying,
246+ isLooping,
247+ isBuffering,
248+ volume,
249+ playbackSpeed,
250+ errorDescription,
251+ size,
252+ rotationCorrection,
253+ isInitialized,
254+ isCompleted,
255+ );
257256}
258257
259258/// Controls a platform video player, and provides updates when the state is
@@ -282,11 +281,11 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
282281 Future <ClosedCaptionFile >? closedCaptionFile,
283282 this .videoPlayerOptions,
284283 this .viewType = VideoViewType .textureView,
285- }) : _closedCaptionFileFuture = closedCaptionFile,
286- dataSourceType = DataSourceType .asset,
287- formatHint = null ,
288- httpHeaders = const < String , String > {},
289- super (const VideoPlayerValue (duration: Duration .zero));
284+ }) : _closedCaptionFileFuture = closedCaptionFile,
285+ dataSourceType = DataSourceType .asset,
286+ formatHint = null ,
287+ httpHeaders = const < String , String > {},
288+ super (const VideoPlayerValue (duration: Duration .zero));
290289
291290 /// Constructs a [VideoPlayerController] playing a network video.
292291 ///
@@ -309,10 +308,10 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
309308 this .videoPlayerOptions,
310309 this .httpHeaders = const < String , String > {},
311310 this .viewType = VideoViewType .textureView,
312- }) : _closedCaptionFileFuture = closedCaptionFile,
313- dataSourceType = DataSourceType .network,
314- package = null ,
315- super (const VideoPlayerValue (duration: Duration .zero));
311+ }) : _closedCaptionFileFuture = closedCaptionFile,
312+ dataSourceType = DataSourceType .network,
313+ package = null ,
314+ super (const VideoPlayerValue (duration: Duration .zero));
316315
317316 /// Constructs a [VideoPlayerController] playing a network video.
318317 ///
@@ -330,11 +329,11 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
330329 this .videoPlayerOptions,
331330 this .httpHeaders = const < String , String > {},
332331 this .viewType = VideoViewType .textureView,
333- }) : _closedCaptionFileFuture = closedCaptionFile,
334- dataSource = url.toString (),
335- dataSourceType = DataSourceType .network,
336- package = null ,
337- super (const VideoPlayerValue (duration: Duration .zero));
332+ }) : _closedCaptionFileFuture = closedCaptionFile,
333+ dataSource = url.toString (),
334+ dataSourceType = DataSourceType .network,
335+ package = null ,
336+ super (const VideoPlayerValue (duration: Duration .zero));
338337
339338 /// Constructs a [VideoPlayerController] playing a video from a file.
340339 ///
@@ -346,12 +345,12 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
346345 this .videoPlayerOptions,
347346 this .httpHeaders = const < String , String > {},
348347 this .viewType = VideoViewType .textureView,
349- }) : _closedCaptionFileFuture = closedCaptionFile,
350- dataSource = Uri .file (file.absolute.path).toString (),
351- dataSourceType = DataSourceType .file,
352- package = null ,
353- formatHint = null ,
354- super (const VideoPlayerValue (duration: Duration .zero));
348+ }) : _closedCaptionFileFuture = closedCaptionFile,
349+ dataSource = Uri .file (file.absolute.path).toString (),
350+ dataSourceType = DataSourceType .file,
351+ package = null ,
352+ formatHint = null ,
353+ super (const VideoPlayerValue (duration: Duration .zero));
355354
356355 /// Constructs a [VideoPlayerController] playing a video from a contentUri.
357356 ///
@@ -362,17 +361,17 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
362361 Future <ClosedCaptionFile >? closedCaptionFile,
363362 this .videoPlayerOptions,
364363 this .viewType = VideoViewType .textureView,
365- }) : assert (
366- defaultTargetPlatform == TargetPlatform .android,
367- 'VideoPlayerController.contentUri is only supported on Android.' ,
368- ),
369- _closedCaptionFileFuture = closedCaptionFile,
370- dataSource = contentUri.toString (),
371- dataSourceType = DataSourceType .contentUri,
372- package = null ,
373- formatHint = null ,
374- httpHeaders = const < String , String > {},
375- super (const VideoPlayerValue (duration: Duration .zero));
364+ }) : assert (
365+ defaultTargetPlatform == TargetPlatform .android,
366+ 'VideoPlayerController.contentUri is only supported on Android.' ,
367+ ),
368+ _closedCaptionFileFuture = closedCaptionFile,
369+ dataSource = contentUri.toString (),
370+ dataSourceType = DataSourceType .contentUri,
371+ package = null ,
372+ formatHint = null ,
373+ httpHeaders = const < String , String > {},
374+ super (const VideoPlayerValue (duration: Duration .zero));
376375
377376 /// The URI to the video file. This will be in different formats depending on
378377 /// the [DataSourceType] of the original video.
@@ -476,7 +475,7 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> {
476475
477476 _playerId =
478477 (await _videoPlayerPlatform.createWithOptions (creationOptions)) ??
479- kUninitializedPlayerId;
478+ kUninitializedPlayerId;
480479 _creatingCompleter! .complete (null );
481480 final Completer <void > initializingCompleter = Completer <void >();
482481
@@ -911,17 +910,17 @@ class _VideoPlayerState extends State<VideoPlayer> {
911910 return _playerId == VideoPlayerController .kUninitializedPlayerId
912911 ? Container ()
913912 : _VideoPlayerWithRotation (
914- rotation: widget.controller.value.rotationCorrection,
915- child: _videoPlayerPlatform.buildViewWithOptions (
916- VideoViewOptions (playerId: _playerId),
917- ),
918- );
913+ rotation: widget.controller.value.rotationCorrection,
914+ child: _videoPlayerPlatform.buildViewWithOptions (
915+ VideoViewOptions (playerId: _playerId),
916+ ),
917+ );
919918 }
920919}
921920
922921class _VideoPlayerWithRotation extends StatelessWidget {
923922 const _VideoPlayerWithRotation ({required this .rotation, required this .child})
924- : assert (rotation % 90 == 0 , 'Rotation must be a multiple of 90' );
923+ : assert (rotation % 90 == 0 , 'Rotation must be a multiple of 90' );
925924
926925 final int rotation;
927926 final Widget child;
@@ -1215,8 +1214,7 @@ class ClosedCaption extends StatelessWidget {
12151214 return const SizedBox .shrink ();
12161215 }
12171216
1218- final TextStyle effectiveTextStyle =
1219- textStyle ??
1217+ final TextStyle effectiveTextStyle = textStyle ??
12201218 DefaultTextStyle .of (
12211219 context,
12221220 ).style.copyWith (fontSize: 36.0 , color: Colors .white);
0 commit comments