Downloading Google Java Format...
Downloading ktfmt...
--packages-for-branch: running on branch "HEAD".
Running for all packages that have diffs relative to "bd297cf6233836099fe1413f9e954ad24ec6f5f0"
Changed packages: image_picker/image_picker
Formatting .java files...
Running command: "java -jar /b/s/w/ir/x/w/packages/.repo_tool_cache/google-java-format-1.28.0-all-deps.jar --replace image_picker/image_picker/example/android/app/src/androidTest/java/io/flutter/plugins/DartIntegrationTest.java image_picker/image_picker/example/android/app/src/androidTest/java/io/flutter/plugins/imagepickerexample/FlutterActivityTest.java image_picker/image_picker/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java image_picker/image_picker/example/android/app/src/main/java/io/flutter/plugins/imagepickerexample/ImagePickerTestActivity.java" in /b/s/w/ir/x/w/packages/packages
Formatting .cc, .cpp, .h, .m, and .mm files...
Running command: "clang-format -i --style=file image_picker/image_picker/example/ios/Runner/GeneratedPluginRegistrant.h image_picker/image_picker/example/ios/Runner/GeneratedPluginRegistrant.m image_picker/image_picker/example/ios/Runner/Runner-Bridging-Header.h image_picker/image_picker/example/linux/flutter/generated_plugin_registrant.cc image_picker/image_picker/example/linux/flutter/generated_plugin_registrant.h image_picker/image_picker/example/linux/main.cc image_picker/image_picker/example/linux/my_application.cc image_picker/image_picker/example/linux/my_application.h image_picker/image_picker/example/windows/flutter/generated_plugin_registrant.cc image_picker/image_picker/example/windows/flutter/generated_plugin_registrant.h image_picker/image_picker/example/windows/runner/flutter_window.cpp image_picker/image_picker/example/windows/runner/flutter_window.h image_picker/image_picker/example/windows/runner/main.cpp image_picker/image_picker/example/windows/runner/resource.h image_picker/image_picker/example/windows/runner/utils.cpp image_picker/image_picker/example/windows/runner/utils.h image_picker/image_picker/example/windows/runner/win32_window.cpp image_picker/image_picker/example/windows/runner/win32_window.h" in /b/s/w/ir/x/w/packages/packages
--packages-for-branch: running on branch "HEAD".
Running for all packages that have diffs relative to "bd297cf6233836099fe1413f9e954ad24ec6f5f0"
Changed packages: image_picker/image_picker
============================================================
|| Running for packages/image_picker/image_picker [@0:02]
============================================================
Formatting .dart files...
Running command: "dart format example/integration_test/image_picker_test.dart example/lib/main.dart example/lib/readme_excerpts.dart example/test/readme_excerpts_test.dart example/test_driver/integration_test.dart lib/image_picker.dart test/image_picker_test.dart test/image_picker_test.mocks.dart" in /b/s/w/ir/x/w/packages/packages/image_picker/image_picker
Formatted test/image_picker_test.dart
Formatted 8 files (1 changed) in 0.06 seconds.
[packages/image_picker/image_picker completed in 0m 0s]
These files are not formatted correctly (see diff below):
packages/image_picker/image_picker/test/image_picker_test.dart
To fix run the repository tooling `format` command:
https://github.com/flutter/packages/blob/main/script/tool/README.md#format-code
or copy-paste this command into your terminal:
patch -p1 <<DONE
diff --git a/packages/image_picker/image_picker/test/image_picker_test.dart b/packages/image_picker/image_picker/test/image_picker_test.dart
index 9d6c589d4..98165ae89 100644
--- a/packages/image_picker/image_picker/test/image_picker_test.dart
+++ b/packages/image_picker/image_picker/test/image_picker_test.dart
@@ -617,54 +617,46 @@ void main() {
expect(() => picker.pickMultiImage(limit: 0), throwsArgumentError);
});
- test(
- 'delegates to pickImage when limit is 1 and image is picked',
- () async {
- when(
- mockPlatform.getImageFromSource(
- source: anyNamed('source'),
- options: anyNamed('options'),
- ),
- ).thenAnswer(
- (Invocation _) async => XFile('test_path', name: 'test.jpg'),
- );
-
- final picker = ImagePicker();
- final List<XFile> result = await picker.pickMultiImage(limit: 1);
-
- expect(result, hasLength(1));
- expect(result.first.path, 'test_path');
- verify(
- mockPlatform.getImageFromSource(
- source: ImageSource.gallery,
- options: anyNamed('options'),
- ),
- );
- },
- );
-
- test(
- 'delegates to pickImage when limit is 1 and no image is picked',
- () async {
- when(
- mockPlatform.getImageFromSource(
- source: anyNamed('source'),
- options: anyNamed('options'),
- ),
- ).thenAnswer((Invocation _) async => null);
+ test('delegates to pickImage when limit is 1 and image is picked', () async {
+ when(
+ mockPlatform.getImageFromSource(
+ source: anyNamed('source'),
+ options: anyNamed('options'),
+ ),
+ ).thenAnswer((Invocation _) async => XFile('test_path', name: 'test.jpg'));
- final picker = ImagePicker();
- final List<XFile> result = await picker.pickMultiImage(limit: 1);
+ final picker = ImagePicker();
+ final List<XFile> result = await picker.pickMultiImage(limit: 1);
- expect(result, isEmpty);
- verify(
- mockPlatform.getImageFromSource(
- source: ImageSource.gallery,
- options: anyNamed('options'),
- ),
- );
- },
- );
+ expect(result, hasLength(1));
+ expect(result.first.path, 'test_path');
+ verify(
+ mockPlatform.getImageFromSource(
+ source: ImageSource.gallery,
+ options: anyNamed('options'),
+ ),
+ );
+ });
+
+ test('delegates to pickImage when limit is 1 and no image is picked', () async {
+ when(
+ mockPlatform.getImageFromSource(
+ source: anyNamed('source'),
+ options: anyNamed('options'),
+ ),
+ ).thenAnswer((Invocation _) async => null);
+
+ final picker = ImagePicker();
+ final List<XFile> result = await picker.pickMultiImage(limit: 1);
+
+ expect(result, isEmpty);
+ verify(
+ mockPlatform.getImageFromSource(
+ source: ImageSource.gallery,
+ options: anyNamed('options'),
+ ),
+ );
+ });
test('handles an empty image file response gracefully', () async {
final picker = ImagePicker();
@@ -1022,58 +1014,52 @@ void main() {
expect(() => picker.pickMultipleMedia(limit: 0), throwsArgumentError);
});
- test(
- 'delegates to pickMedia when limit is 1 and media is picked',
- () async {
- when(
- mockPlatform.getMedia(options: anyNamed('options')),
- ).thenAnswer((Invocation _) async => <XFile>[XFile('test_path')]);
-
- final picker = ImagePicker();
- final List<XFile> result = await picker.pickMultipleMedia(limit: 1);
-
- expect(result, hasLength(1));
- expect(result.first.path, 'test_path');
- verify(
- mockPlatform.getMedia(
- options: argThat(
- isInstanceOf<MediaOptions>().having(
- (MediaOptions options) => options.allowMultiple,
- 'allowMultiple',
- isFalse,
- ),
- named: 'options',
+ test('delegates to pickMedia when limit is 1 and media is picked', () async {
+ when(
+ mockPlatform.getMedia(options: anyNamed('options')),
+ ).thenAnswer((Invocation _) async => <XFile>[XFile('test_path')]);
+
+ final picker = ImagePicker();
+ final List<XFile> result = await picker.pickMultipleMedia(limit: 1);
+
+ expect(result, hasLength(1));
+ expect(result.first.path, 'test_path');
+ verify(
+ mockPlatform.getMedia(
+ options: argThat(
+ isInstanceOf<MediaOptions>().having(
+ (MediaOptions options) => options.allowMultiple,
+ 'allowMultiple',
+ isFalse,
),
+ named: 'options',
),
- );
- },
- );
-
- test(
- 'delegates to pickMedia when limit is 1 and no media is picked',
- () async {
- when(
- mockPlatform.getMedia(options: anyNamed('options')),
- ).thenAnswer((Invocation _) async => <XFile>[]);
-
- final picker = ImagePicker();
- final List<XFile> result = await picker.pickMultipleMedia(limit: 1);
-
- expect(result, isEmpty);
- verify(
- mockPlatform.getMedia(
- options: argThat(
- isInstanceOf<MediaOptions>().having(
- (MediaOptions options) => options.allowMultiple,
- 'allowMultiple',
- isFalse,
- ),
- named: 'options',
+ ),
+ );
+ });
+
+ test('delegates to pickMedia when limit is 1 and no media is picked', () async {
+ when(
+ mockPlatform.getMedia(options: anyNamed('options')),
+ ).thenAnswer((Invocation _) async => <XFile>[]);
+
+ final picker = ImagePicker();
+ final List<XFile> result = await picker.pickMultipleMedia(limit: 1);
+
+ expect(result, isEmpty);
+ verify(
+ mockPlatform.getMedia(
+ options: argThat(
+ isInstanceOf<MediaOptions>().having(
+ (MediaOptions options) => options.allowMultiple,
+ 'allowMultiple',
+ isFalse,
),
+ named: 'options',
),
- );
- },
- );
+ ),
+ );
+ });
test('handles an empty image file response gracefully', () async {
final picker = ImagePicker();
DONE