Skip to content

Commit e97bab3

Browse files
author
Michael Klimushyn
authored
[video_player_platform_interface] Fix some pedantic lints (flutter#2349)
Fixes unawaited_futures. There are still some undocumented members here that are unclear to me, so unfortunately the analysis_options.yaml is still there.
1 parent 2a2cb11 commit e97bab3

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

packages/video_player/video_player_platform_interface/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.2
2+
3+
* Fix unawaited futures in the tests.
4+
15
## 1.0.1
26

37
* Return correct platform event type when buffering

packages/video_player/video_player_platform_interface/analysis_options.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ include: ../../../analysis_options.yaml
88
analyzer:
99
errors:
1010
public_member_api_docs: ignore
11-
unawaited_futures: ignore

packages/video_player/video_player_platform_interface/lib/video_player_platform_interface.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ abstract class VideoPlayerPlatform {
2727
@visibleForTesting
2828
bool get isMock => false;
2929

30+
static VideoPlayerPlatform _instance = MethodChannelVideoPlayer();
31+
3032
/// The default instance of [VideoPlayerPlatform] to use.
3133
///
3234
/// Platform-specific plugins should override this with their own
3335
/// platform-specific class that extends [VideoPlayerPlatform] when they
3436
/// register themselves.
3537
///
3638
/// Defaults to [MethodChannelVideoPlayer].
37-
static VideoPlayerPlatform _instance = MethodChannelVideoPlayer();
38-
3939
static VideoPlayerPlatform get instance => _instance;
4040

4141
// TODO(amirh): Extract common platform interface logic.

packages/video_player/video_player_platform_interface/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: Flutter Team <[email protected]>
44
homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player_platform_interface
55
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
66
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
7-
version: 1.0.1
7+
version: 1.0.2
88

99
dependencies:
1010
flutter:

packages/video_player/video_player_platform_interface/test/method_channel_video_player_test.dart

+5-5
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ void main() {
233233
// with `ServicesBinding.instance.defaultBinaryMessenger` when it's
234234
// available on all the versions of Flutter that we test.
235235
// ignore: deprecated_member_use
236-
defaultBinaryMessenger.handlePlatformMessage(
236+
await defaultBinaryMessenger.handlePlatformMessage(
237237
"flutter.io/videoPlayer/videoEvents123",
238238
const StandardMethodCodec()
239239
.encodeSuccessEnvelope(<String, dynamic>{
@@ -248,7 +248,7 @@ void main() {
248248
// with `ServicesBinding.instance.defaultBinaryMessenger` when it's
249249
// available on all the versions of Flutter that we test.
250250
// ignore: deprecated_member_use
251-
defaultBinaryMessenger.handlePlatformMessage(
251+
await defaultBinaryMessenger.handlePlatformMessage(
252252
"flutter.io/videoPlayer/videoEvents123",
253253
const StandardMethodCodec()
254254
.encodeSuccessEnvelope(<String, dynamic>{
@@ -260,7 +260,7 @@ void main() {
260260
// with `ServicesBinding.instance.defaultBinaryMessenger` when it's
261261
// available on all the versions of Flutter that we test.
262262
// ignore: deprecated_member_use
263-
defaultBinaryMessenger.handlePlatformMessage(
263+
await defaultBinaryMessenger.handlePlatformMessage(
264264
"flutter.io/videoPlayer/videoEvents123",
265265
const StandardMethodCodec()
266266
.encodeSuccessEnvelope(<String, dynamic>{
@@ -276,7 +276,7 @@ void main() {
276276
// with `ServicesBinding.instance.defaultBinaryMessenger` when it's
277277
// available on all the versions of Flutter that we test.
278278
// ignore: deprecated_member_use
279-
defaultBinaryMessenger.handlePlatformMessage(
279+
await defaultBinaryMessenger.handlePlatformMessage(
280280
"flutter.io/videoPlayer/videoEvents123",
281281
const StandardMethodCodec()
282282
.encodeSuccessEnvelope(<String, dynamic>{
@@ -288,7 +288,7 @@ void main() {
288288
// with `ServicesBinding.instance.defaultBinaryMessenger` when it's
289289
// available on all the versions of Flutter that we test.
290290
// ignore: deprecated_member_use
291-
defaultBinaryMessenger.handlePlatformMessage(
291+
await defaultBinaryMessenger.handlePlatformMessage(
292292
"flutter.io/videoPlayer/videoEvents123",
293293
const StandardMethodCodec()
294294
.encodeSuccessEnvelope(<String, dynamic>{

0 commit comments

Comments
 (0)