This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +24
-2
lines changed
Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 1+ ## 0.6.5+1
2+
3+ * Fix a bug, sometimes double click cancel button will crash.
4+
15## 0.6.5
26
37* Set maximum duration for video recording.
Original file line number Diff line number Diff line change @@ -327,8 +327,10 @@ - (void)imagePickerController:(UIImagePickerController *)picker
327327
328328- (void )imagePickerControllerDidCancel : (UIImagePickerController *)picker {
329329 [_imagePickerController dismissViewControllerAnimated: YES completion: nil ];
330+ if (!self.result ) {
331+ return ;
332+ }
330333 self.result (nil );
331-
332334 self.result = nil ;
333335 _arguments = nil ;
334336}
Original file line number Diff line number Diff line change @@ -61,6 +61,22 @@ - (void)testPluginPickVideoDeviceBack {
6161 UIImagePickerControllerCameraDeviceRear);
6262}
6363
64+ - (void )testPluginPickImageDeviceCancel {
65+ if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) {
66+ return ;
67+ }
68+ FLTImagePickerPlugin *plugin =
69+ [[FLTImagePickerPlugin alloc ] initWithViewController: [UIViewController new ]];
70+ FlutterMethodCall *call =
71+ [FlutterMethodCall methodCallWithMethodName: @" pickImage"
72+ arguments: @{@" source" : @(0 ), @" cameraDevice" : @(1 )}];
73+ [plugin handleMethodCall: call
74+ result: ^(id _Nullable r){
75+ }];
76+ // todo test imagePickerControllerDidCancel when result is nil
77+
78+ }
79+
6480- (void )testPluginPickVideoDeviceFront {
6581 if (![UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) {
6682 return ;
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
5+ version : 0.6.5+1
66
77flutter :
88 plugin :
You can’t perform that action at this time.
0 commit comments