Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit a09b02f

Browse files
committed
Merge branch 'master' into feature/camera_exposure_auto_platform_interface
# Conflicts: # packages/camera/camera/CHANGELOG.md # packages/camera/camera/ios/Classes/CameraPlugin.m
2 parents 945f05d + 622ba57 commit a09b02f

File tree

18 files changed

+50
-24
lines changed

18 files changed

+50
-24
lines changed

packages/camera/camera/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
* Adds torch mode as a flash mode for Android and iOS implementations.
44

5+
## 0.6.2+1
6+
7+
* Fix the API documentation for the `CameraController.takePicture` method.
8+
59
## 0.6.2
610

711
* Add zoom support for Android and iOS implementations.

packages/camera/camera/ios/Classes/CameraPlugin.m

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -913,12 +913,6 @@ - (BOOL)setupWriterForPath:(NSString *)path {
913913
[self.captureDevice unlockForConfiguration];
914914
}
915915

916-
if (_flashMode == FlashModeTorch) {
917-
[self.captureDevice lockForConfiguration:nil];
918-
[self.captureDevice setTorchMode:AVCaptureTorchModeOn];
919-
[self.captureDevice unlockForConfiguration];
920-
}
921-
922916
[_videoWriter addInput:_videoWriterInput];
923917
[_captureVideoOutput setSampleBufferDelegate:self queue:_dispatchQueue];
924918

packages/camera/camera/lib/src/camera_controller.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,7 @@ class CameraController extends ValueNotifier<CameraValue> {
226226
await CameraPlatform.instance.prepareForVideoRecording();
227227
}
228228

229-
/// Captures an image and saves it to [path].
230-
///
231-
/// A path can for example be obtained using
232-
/// [path_provider](https://pub.dartlang.org/packages/path_provider).
233-
///
234-
/// If a file already exists at the provided path an error will be thrown.
235-
/// The file can be read as this function returns.
229+
/// Captures an image and returns the file where it was saved.
236230
///
237231
/// Throws a [CameraException] if the capture fails.
238232
Future<XFile> takePicture() async {

packages/cross_file/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.2.0
2+
3+
* **breaking change** Make sure the `saveTo` method returns a `Future` so it can be awaited and users are sure the file has been written to disk.
4+
15
## 0.1.0+2
26

37
* Fix outdated links across a number of markdown files ([#3276](https://github.com/flutter/plugins/pull/3276))

packages/cross_file/lib/src/types/base.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ abstract class XFileBase {
1818
XFileBase(String path);
1919

2020
/// Save the CrossFile at the indicated file path.
21-
void saveTo(String path) async {
21+
Future<void> saveTo(String path) {
2222
throw UnimplementedError('saveTo has not been implemented.');
2323
}
2424

packages/cross_file/lib/src/types/html.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class XFile extends XFileBase {
108108

109109
/// Saves the data of this CrossFile at the location indicated by path.
110110
/// For the web implementation, the path variable is ignored.
111-
void saveTo(String path) async {
111+
Future<void> saveTo(String path) async {
112112
// Create a DOM container where we can host the anchor.
113113
_target = ensureInitialized('__x_file_dom_element');
114114

packages/cross_file/lib/src/types/io.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class XFile extends XFileBase {
5757
}
5858

5959
@override
60-
void saveTo(String path) async {
60+
Future<void> saveTo(String path) async {
6161
File fileToSave = File(path);
6262
await fileToSave.writeAsBytes(_bytes ?? (await readAsBytes()));
6363
await fileToSave.create();

packages/cross_file/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: cross_file
22
description: An abstraction to allow working with files across multiple platforms.
33
homepage: https://github.com/flutter/plugins/tree/master/packages/cross_file
4-
version: 0.1.0+2
4+
version: 0.2.0
55

66
dependencies:
77
flutter:

packages/image_picker/image_picker/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.6.7+19
2+
3+
* Do not copy static field to another static field.
4+
15
## 0.6.7+18
26

37
* Fix outdated links across a number of markdown files ([#3276](https://github.com/flutter/plugins/pull/3276))

packages/image_picker/image_picker/lib/image_picker.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export 'package:image_picker_platform_interface/image_picker_platform_interface.
2727
class ImagePicker {
2828
/// The platform interface that drives this plugin
2929
@visibleForTesting
30-
static ImagePickerPlatform platform = ImagePickerPlatform.instance;
30+
static ImagePickerPlatform get platform => ImagePickerPlatform.instance;
3131

3232
/// Returns a [File] object pointing to the image that was picked.
3333
///

packages/image_picker/image_picker/pubspec.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: image_picker
22
description: Flutter plugin for selecting images from the Android and iOS image
33
library, and taking new pictures with the camera.
44
homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker
5-
version: 0.6.7+18
5+
version: 0.6.7+19
66

77
flutter:
88
plugin:
@@ -25,7 +25,9 @@ dev_dependencies:
2525
sdk: flutter
2626
integration_test:
2727
path: ../../integration_test
28+
mockito: ^4.1.3
2829
pedantic: ^1.8.0
30+
plugin_platform_interface: ^1.0.3
2931

3032
environment:
3133
sdk: ">=2.1.0 <3.0.0"

packages/image_picker/image_picker/test/image_picker_test.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
import 'package:flutter/services.dart';
66
import 'package:flutter_test/flutter_test.dart';
77
import 'package:image_picker/image_picker.dart';
8+
import 'package:image_picker_platform_interface/image_picker_platform_interface.dart';
9+
import 'package:mockito/mockito.dart';
10+
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
811

912
void main() {
1013
TestWidgetsFlutterBinding.ensureInitialized();
@@ -26,6 +29,15 @@ void main() {
2629
log.clear();
2730
});
2831

32+
test('ImagePicker platform instance overrides the actual platform used',
33+
() {
34+
final ImagePickerPlatform savedPlatform = ImagePickerPlatform.instance;
35+
final MockPlatform mockPlatform = MockPlatform();
36+
ImagePickerPlatform.instance = mockPlatform;
37+
expect(ImagePicker.platform, mockPlatform);
38+
ImagePickerPlatform.instance = savedPlatform;
39+
});
40+
2941
group('#pickImage', () {
3042
test('passes the image source argument correctly', () async {
3143
await picker.getImage(source: ImageSource.camera);
@@ -336,3 +348,7 @@ void main() {
336348
});
337349
});
338350
}
351+
352+
class MockPlatform extends Mock
353+
with MockPlatformInterfaceMixin
354+
implements ImagePickerPlatform {}

packages/url_launcher/url_launcher/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 6.0.0-nullsafety.3
2+
3+
* forceSafariVC should be nullable.
4+
15
## 6.0.0-nullsafety.2
26

37
* Fix outdated links across a number of markdown files ([#3276](https://github.com/flutter/plugins/pull/3276))

packages/url_launcher/url_launcher/lib/url_launcher.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ import 'package:url_launcher_platform_interface/url_launcher_platform_interface.
6262
/// is set to true and the universal link failed to launch.
6363
Future<bool> launch(
6464
String urlString, {
65-
bool forceSafariVC = true,
65+
bool? forceSafariVC,
6666
bool forceWebView = false,
6767
bool enableJavaScript = false,
6868
bool enableDomStorage = false,
@@ -95,7 +95,7 @@ Future<bool> launch(
9595

9696
final bool result = await UrlLauncherPlatform.instance.launch(
9797
urlString,
98-
useSafariVC: forceSafariVC,
98+
useSafariVC: forceSafariVC ?? isWebURL,
9999
useWebView: forceWebView,
100100
enableJavaScript: enableJavaScript,
101101
enableDomStorage: enableDomStorage,

packages/url_launcher/url_launcher/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: url_launcher
22
description: Flutter plugin for launching a URL on Android and iOS. Supports
33
web, phone, SMS, and email schemes.
44
homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher
5-
version: 6.0.0-nullsafety.2
5+
version: 6.0.0-nullsafety.3
66

77
flutter:
88
plugin:

packages/video_player/video_player/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.0.0-nullsafety.6
2+
3+
* Fix `VideoPlayerValue toString()` test.
4+
15
## 2.0.0-nullsafety.5
26

37
* Fix outdated links across a number of markdown files ([#3276](https://github.com/flutter/plugins/pull/3276))

packages/video_player/video_player/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Flutter plugin for displaying inline video with other Flutter
44
# 0.10.y+z is compatible with 1.0.0, if you land a breaking change bump
55
# the version to 2.0.0.
66
# See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0
7-
version: 2.0.0-nullsafety.5
7+
version: 2.0.0-nullsafety.6
88
homepage: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player
99

1010
flutter:

packages/video_player/video_player/test/video_player_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ void main() {
567567
'VideoPlayerValue(duration: 0:00:05.000000, '
568568
'size: Size(400.0, 300.0), '
569569
'position: 0:00:01.000000, '
570-
'caption: Caption(number: null, start: null, end: null, text: foo), '
570+
'caption: Caption(number: 0, start: 0:00:00.000000, end: 0:00:00.000000, text: foo), '
571571
'buffered: [DurationRange(start: 0:00:00.000000, end: 0:00:04.000000)], '
572572
'isInitialized: true, '
573573
'isPlaying: true, '

0 commit comments

Comments
 (0)