Skip to content

Commit

Permalink
Merge branch 'master' into add_zoom_to_android_webview
Browse files Browse the repository at this point in the history
* master:
  [url_launcher] forceSafariVC should be nullable to avoid breaking change (flutter#3354)
  [image_picker] Do not copy a static field into another static field (flutter#3353)
  [video_player] Fix video player test (flutter#3361)
  • Loading branch information
NickalasB committed Dec 22, 2020
2 parents b45594c + 0f1c20d commit df9a0a9
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 7 deletions.
4 changes: 4 additions & 0 deletions packages/image_picker/image_picker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.7+19

* Do not copy static field to another static field.

## 0.6.7+18

* Fix outdated links across a number of markdown files ([#3276](https://github.com/flutter/plugins/pull/3276))
Expand Down
2 changes: 1 addition & 1 deletion packages/image_picker/image_picker/lib/image_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export 'package:image_picker_platform_interface/image_picker_platform_interface.
class ImagePicker {
/// The platform interface that drives this plugin
@visibleForTesting
static ImagePickerPlatform platform = ImagePickerPlatform.instance;
static ImagePickerPlatform get platform => ImagePickerPlatform.instance;

/// Returns a [File] object pointing to the image that was picked.
///
Expand Down
4 changes: 3 additions & 1 deletion packages/image_picker/image_picker/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: image_picker
description: Flutter plugin for selecting images from the Android and iOS image
library, and taking new pictures with the camera.
homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker
version: 0.6.7+18
version: 0.6.7+19

flutter:
plugin:
Expand All @@ -25,7 +25,9 @@ dev_dependencies:
sdk: flutter
integration_test:
path: ../../integration_test
mockito: ^4.1.3
pedantic: ^1.8.0
plugin_platform_interface: ^1.0.3

environment:
sdk: ">=2.1.0 <3.0.0"
Expand Down
16 changes: 16 additions & 0 deletions packages/image_picker/image_picker/test/image_picker_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:image_picker/image_picker.dart';
import 'package:image_picker_platform_interface/image_picker_platform_interface.dart';
import 'package:mockito/mockito.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

void main() {
TestWidgetsFlutterBinding.ensureInitialized();
Expand All @@ -26,6 +29,15 @@ void main() {
log.clear();
});

test('ImagePicker platform instance overrides the actual platform used',
() {
final ImagePickerPlatform savedPlatform = ImagePickerPlatform.instance;
final MockPlatform mockPlatform = MockPlatform();
ImagePickerPlatform.instance = mockPlatform;
expect(ImagePicker.platform, mockPlatform);
ImagePickerPlatform.instance = savedPlatform;
});

group('#pickImage', () {
test('passes the image source argument correctly', () async {
await picker.getImage(source: ImageSource.camera);
Expand Down Expand Up @@ -336,3 +348,7 @@ void main() {
});
});
}

class MockPlatform extends Mock
with MockPlatformInterfaceMixin
implements ImagePickerPlatform {}
4 changes: 4 additions & 0 deletions packages/url_launcher/url_launcher/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 6.0.0-nullsafety.3

* forceSafariVC should be nullable.

## 6.0.0-nullsafety.2

* Fix outdated links across a number of markdown files ([#3276](https://github.com/flutter/plugins/pull/3276))
Expand Down
4 changes: 2 additions & 2 deletions packages/url_launcher/url_launcher/lib/url_launcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import 'package:url_launcher_platform_interface/url_launcher_platform_interface.
/// is set to true and the universal link failed to launch.
Future<bool> launch(
String urlString, {
bool forceSafariVC = true,
bool? forceSafariVC,
bool forceWebView = false,
bool enableJavaScript = false,
bool enableDomStorage = false,
Expand Down Expand Up @@ -95,7 +95,7 @@ Future<bool> launch(

final bool result = await UrlLauncherPlatform.instance.launch(
urlString,
useSafariVC: forceSafariVC,
useSafariVC: forceSafariVC ?? isWebURL,
useWebView: forceWebView,
enableJavaScript: enableJavaScript,
enableDomStorage: enableDomStorage,
Expand Down
2 changes: 1 addition & 1 deletion packages/url_launcher/url_launcher/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: url_launcher
description: Flutter plugin for launching a URL on Android and iOS. Supports
web, phone, SMS, and email schemes.
homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher
version: 6.0.0-nullsafety.2
version: 6.0.0-nullsafety.3

flutter:
plugin:
Expand Down
4 changes: 4 additions & 0 deletions packages/video_player/video_player/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.0.0-nullsafety.6

* Fix `VideoPlayerValue toString()` test.

## 2.0.0-nullsafety.5

* Fix outdated links across a number of markdown files ([#3276](https://github.com/flutter/plugins/pull/3276))
Expand Down
2 changes: 1 addition & 1 deletion packages/video_player/video_player/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Flutter plugin for displaying inline video with other Flutter
# 0.10.y+z is compatible with 1.0.0, if you land a breaking change bump
# the version to 2.0.0.
# See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0
version: 2.0.0-nullsafety.5
version: 2.0.0-nullsafety.6
homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player

flutter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ void main() {
'VideoPlayerValue(duration: 0:00:05.000000, '
'size: Size(400.0, 300.0), '
'position: 0:00:01.000000, '
'caption: Caption(number: null, start: null, end: null, text: foo), '
'caption: Caption(number: 0, start: 0:00:00.000000, end: 0:00:00.000000, text: foo), '
'buffered: [DurationRange(start: 0:00:00.000000, end: 0:00:04.000000)], '
'isInitialized: true, '
'isPlaying: true, '
Expand Down

0 comments on commit df9a0a9

Please sign in to comment.