Skip to content

Commit 27bcb3b

Browse files
committed
Format code and regenerate mocks after rebase
1 parent bc798f2 commit 27bcb3b

File tree

20 files changed

+761
-631
lines changed

20 files changed

+761
-631
lines changed

packages/video_player/video_player/example/integration_test/video_player_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ void main() {
5656
});
5757

5858
testWidgets('live stream duration != 0', (WidgetTester tester) async {
59-
final VideoPlayerController
60-
networkController = VideoPlayerController.networkUrl(
59+
final VideoPlayerController networkController =
60+
VideoPlayerController.networkUrl(
6161
Uri.parse(
6262
'https://flutter.github.io/assets-for-api-docs/assets/videos/hls/bee.m3u8',
6363
),
@@ -312,8 +312,8 @@ void main() {
312312
skip:
313313
// MEDIA_ELEMENT_ERROR on web, see https://github.com/flutter/flutter/issues/169219
314314
kIsWeb ||
315-
// Hanging on Android, see https://github.com/flutter/flutter/issues/160797
316-
defaultTargetPlatform == TargetPlatform.android,
315+
// Hanging on Android, see https://github.com/flutter/flutter/issues/160797
316+
defaultTargetPlatform == TargetPlatform.android,
317317
);
318318
});
319319

packages/video_player/video_player/example/lib/basic.dart

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ class _VideoAppState extends State<VideoApp> {
2828
void initState() {
2929
super.initState();
3030
_controller = VideoPlayerController.networkUrl(
31-
Uri.parse(
32-
'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4',
33-
),
34-
)
35-
..initialize().then((_) {
31+
Uri.parse(
32+
'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4',
33+
),
34+
)..initialize().then((_) {
3635
// Ensure the first frame is shown after the video is initialized, even before the play button has been pressed.
3736
setState(() {});
3837
});
@@ -44,13 +43,12 @@ class _VideoAppState extends State<VideoApp> {
4443
title: 'Video Demo',
4544
home: Scaffold(
4645
body: Center(
47-
child:
48-
_controller.value.isInitialized
49-
? AspectRatio(
50-
aspectRatio: _controller.value.aspectRatio,
51-
child: VideoPlayer(_controller),
52-
)
53-
: Container(),
46+
child: _controller.value.isInitialized
47+
? AspectRatio(
48+
aspectRatio: _controller.value.aspectRatio,
49+
child: VideoPlayer(_controller),
50+
)
51+
: Container(),
5452
),
5553
floatingActionButton: FloatingActionButton(
5654
onPressed: () {

packages/video_player/video_player/example/lib/main.dart

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,16 @@ class _App extends StatelessWidget {
5050
body: TabBarView(
5151
children: <Widget>[
5252
_ViewTypeTabBar(
53-
builder:
54-
(VideoViewType viewType) => _BumbleBeeRemoteVideo(viewType),
53+
builder: (VideoViewType viewType) =>
54+
_BumbleBeeRemoteVideo(viewType),
5555
),
5656
_ViewTypeTabBar(
57-
builder:
58-
(VideoViewType viewType) => _ButterFlyAssetVideo(viewType),
57+
builder: (VideoViewType viewType) =>
58+
_ButterFlyAssetVideo(viewType),
5959
),
6060
_ViewTypeTabBar(
61-
builder:
62-
(VideoViewType viewType) =>
63-
_ButterFlyAssetVideoInList(viewType),
61+
builder: (VideoViewType viewType) =>
62+
_ButterFlyAssetVideoInList(viewType),
6463
),
6564
],
6665
),
@@ -146,8 +145,7 @@ class _ButterFlyAssetVideoInList extends StatelessWidget {
146145
title: Text('Video video'),
147146
),
148147
Stack(
149-
alignment:
150-
FractionalOffset.bottomRight +
148+
alignment: FractionalOffset.bottomRight +
151149
const FractionalOffset(-0.1, -0.1),
152150
children: <Widget>[
153151
_ButterFlyAssetVideo(viewType),
@@ -381,20 +379,19 @@ class _ControlsOverlay extends StatelessWidget {
381379
AnimatedSwitcher(
382380
duration: const Duration(milliseconds: 50),
383381
reverseDuration: const Duration(milliseconds: 200),
384-
child:
385-
controller.value.isPlaying
386-
? const SizedBox.shrink()
387-
: const ColoredBox(
388-
color: Colors.black26,
389-
child: Center(
390-
child: Icon(
391-
Icons.play_arrow,
392-
color: Colors.white,
393-
size: 100.0,
394-
semanticLabel: 'Play',
395-
),
382+
child: controller.value.isPlaying
383+
? const SizedBox.shrink()
384+
: const ColoredBox(
385+
color: Colors.black26,
386+
child: Center(
387+
child: Icon(
388+
Icons.play_arrow,
389+
color: Colors.white,
390+
size: 100.0,
391+
semanticLabel: 'Play',
396392
),
397393
),
394+
),
398395
),
399396
GestureDetector(
400397
onTap: () {

packages/video_player/video_player/lib/src/sub_rip.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class SubRipCaptionFile extends ClosedCaptionFile {
1313
/// the SubRip file format.
1414
/// * See: https://en.wikipedia.org/wiki/SubRip
1515
SubRipCaptionFile(this.fileContents)
16-
: _captions = _parseCaptionsFromSubRipString(fileContents);
16+
: _captions = _parseCaptionsFromSubRipString(fileContents);
1717

1818
/// The entire body of the SubRip file.
1919
// TODO(cyanglaz): Remove this public member as it doesn't seem need to exist.

packages/video_player/video_player/lib/src/web_vtt.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class WebVTTCaptionFile extends ClosedCaptionFile {
1616
/// the WebVTT file format.
1717
/// * See: https://en.wikipedia.org/wiki/WebVTT
1818
WebVTTCaptionFile(String fileContents)
19-
: _captions = _parseCaptionsFromWebVTTString(fileContents);
19+
: _captions = _parseCaptionsFromWebVTTString(fileContents);
2020

2121
@override
2222
List<Caption> get captions => _captions;

packages/video_player/video_player/lib/video_player.dart

Lines changed: 64 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -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

922921
class _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

Comments
 (0)