File tree Expand file tree Collapse file tree 4 files changed +31
-3
lines changed
Expand file tree Collapse file tree 4 files changed +31
-3
lines changed Original file line number Diff line number Diff line change 1+ ## 0.6.6
2+
3+ * Fixes crash when an image in the gallery is tapped more than once.
4+
15## 0.6.5+1
26
37* Fix CocoaPods podspec lint warnings.
Original file line number Diff line number Diff line change @@ -279,7 +279,7 @@ - (void)imagePickerController:(UIImagePickerController *)picker
279279 }
280280 self.result (videoURL.path );
281281 self.result = nil ;
282-
282+ _arguments = nil ;
283283 } else {
284284 UIImage *image = [info objectForKey: UIImagePickerControllerEditedImage];
285285 if (image == nil ) {
@@ -322,7 +322,6 @@ - (void)imagePickerController:(UIImagePickerController *)picker
322322 }];
323323 }
324324 }
325- _arguments = nil ;
326325}
327326
328327- (void )imagePickerControllerDidCancel : (UIImagePickerController *)picker {
@@ -357,6 +356,9 @@ - (void)saveImageWithPickerInfo:(NSDictionary *)info
357356}
358357
359358- (void )handleSavedPath : (NSString *)path {
359+ if (!self.result ) {
360+ return ;
361+ }
360362 if (path) {
361363 self.result (path);
362364 } else {
@@ -365,6 +367,7 @@ - (void)handleSavedPath:(NSString *)path {
365367 details: nil ]);
366368 }
367369 self.result = nil ;
370+ _arguments = nil ;
368371}
369372
370373@end
Original file line number Diff line number Diff line change 77@import image_picker;
88@import XCTest;
99
10+ @interface FLTImagePickerPlugin (Test)
11+ @property (copy , nonatomic ) FlutterResult result;
12+ - (void )handleSavedPath : (NSString *)path ;
13+ @end
14+
1015@interface ImagePickerPluginTests : XCTestCase
1116@end
1217
@@ -90,4 +95,20 @@ - (void)testPickingVideoWithDuration {
9095 XCTAssertEqual ([plugin getImagePickerController ].videoMaximumDuration , 95 );
9196}
9297
98+ - (void )testPluginPickImageSelectMultipleTimes {
99+ FLTImagePickerPlugin *plugin =
100+ [[FLTImagePickerPlugin alloc ] initWithViewController: [UIViewController new ]];
101+ FlutterMethodCall *call =
102+ [FlutterMethodCall methodCallWithMethodName: @" pickImage"
103+ arguments: @{@" source" : @(0 ), @" cameraDevice" : @(0 )}];
104+ [plugin handleMethodCall: call
105+ result: ^(id _Nullable r){
106+ }];
107+ plugin.result = ^(id result) {
108+
109+ };
110+ [plugin handleSavedPath: @" test" ];
111+ [plugin handleSavedPath: @" test" ];
112+ }
113+
93114@end
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: image_picker
22description : Flutter plugin for selecting images from the Android and iOS image
33 library, and taking new pictures with the camera.
44homepage : https://github.com/flutter/plugins/tree/master/packages/image_picker
5- version : 0.6.5+1
5+ version : 0.6.6
66
77flutter :
88 plugin :
You can’t perform that action at this time.
0 commit comments