[video_player] Add missing template type parameter to `invokeMethod` calls. Bump minimum Flutter version to 1.5.0. Replace invokeMethod with invokeMapMethod wherever necessary.
diff --git a/packages/video_player/CHANGELOG.md b/packages/video_player/CHANGELOG.md index b2e88d2..559456c 100644 --- a/packages/video_player/CHANGELOG.md +++ b/packages/video_player/CHANGELOG.md
@@ -1,3 +1,9 @@ +## 0.10.1+3 + +* Add missing template type parameter to `invokeMethod` calls. +* Bump minimum Flutter version to 1.5.0. +* Replace invokeMethod with invokeMapMethod wherever necessary. + ## 0.10.1+2 * Example: Fixed tab display and added scroll view
diff --git a/packages/video_player/lib/video_player.dart b/packages/video_player/lib/video_player.dart index ce4ac70..fb42096 100644 --- a/packages/video_player/lib/video_player.dart +++ b/packages/video_player/lib/video_player.dart
@@ -12,10 +12,7 @@ final MethodChannel _channel = const MethodChannel('flutter.io/videoPlayer') // This will clear all open videos on the platform when a full restart is // performed. - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - ..invokeMethod('init'); + ..invokeMethod<void>('init'); class DurationRange { DurationRange(this.start, this.end); @@ -208,10 +205,8 @@ case DataSourceType.file: dataSourceDescription = <String, dynamic>{'uri': dataSource}; } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - final Map<dynamic, dynamic> response = await _channel.invokeMethod( + final Map<String, dynamic> response = + await _channel.invokeMapMethod<String, dynamic>( 'create', dataSourceDescription, ); @@ -284,10 +279,7 @@ _isDisposed = true; _timer?.cancel(); await _eventSubscription?.cancel(); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod( + await _channel.invokeMethod<void>( 'dispose', <String, dynamic>{'textureId': _textureId}, ); @@ -317,10 +309,7 @@ if (!value.initialized || _isDisposed) { return; } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - _channel.invokeMethod( + _channel.invokeMethod<void>( 'setLooping', <String, dynamic>{'textureId': _textureId, 'looping': value.isLooping}, ); @@ -331,10 +320,7 @@ return; } if (value.isPlaying) { - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod( + await _channel.invokeMethod<void>( 'play', <String, dynamic>{'textureId': _textureId}, ); @@ -353,10 +339,7 @@ ); } else { _timer?.cancel(); - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod( + await _channel.invokeMethod<void>( 'pause', <String, dynamic>{'textureId': _textureId}, ); @@ -367,10 +350,7 @@ if (!value.initialized || _isDisposed) { return; } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod( + await _channel.invokeMethod<void>( 'setVolume', <String, dynamic>{'textureId': _textureId, 'volume': value.volume}, ); @@ -382,10 +362,7 @@ return null; } return Duration( - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - milliseconds: await _channel.invokeMethod( + milliseconds: await _channel.invokeMethod<int>( 'position', <String, dynamic>{'textureId': _textureId}, ), @@ -401,10 +378,7 @@ } else if (moment < const Duration()) { moment = const Duration(); } - // TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter. - // https://github.com/flutter/flutter/issues/26431 - // ignore: strong_mode_implicit_dynamic_method - await _channel.invokeMethod('seekTo', <String, dynamic>{ + await _channel.invokeMethod<void>('seekTo', <String, dynamic>{ 'textureId': _textureId, 'location': moment.inMilliseconds, });
diff --git a/packages/video_player/pubspec.yaml b/packages/video_player/pubspec.yaml index 4142af1..8ed4025 100644 --- a/packages/video_player/pubspec.yaml +++ b/packages/video_player/pubspec.yaml
@@ -2,7 +2,7 @@ description: Flutter plugin for displaying inline video with other Flutter widgets on Android and iOS. author: Flutter Team <flutter-dev@googlegroups.com> -version: 0.10.1+2 +version: 0.10.1+3 homepage: https://github.com/flutter/plugins/tree/master/packages/video_player flutter: @@ -22,4 +22,4 @@ environment: sdk: ">=2.0.0-dev.28.0 <3.0.0" - flutter: ">=0.2.5 <2.0.0" + flutter: ">=1.5.0 <2.0.0"