-
Notifications
You must be signed in to change notification settings - Fork 704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The app is moved to inactive state when the file picker is presented on iOS #813
Comments
Hum. The file_picker is also opened in a modal and the app is kept on background while doing the task of picking. Are you telling me that the image_picker doesn’t do that? |
@miguelpruivo Currently, both document picker and image/gallery picker on iOS are not being opened modally. They open on full screen and put the app in inactive state. This is the log when I open the picker, select a file and then the picker closes
@miguelpruivo The image_picker opens the view modally without putting the app in background. |
Ok, I'll take a look. |
@miguelpruivo Thanks. Or if you could just guide me or tell me a hint where to look at then I can fork the repo and submit the pull request. I have never created packages for flutter before, that's why I am asking |
@rohitrvayuz I'm right now looking into it, however, what is the plugin that you're saying that opens modally? Because the image_picker opens it exactly the same way as this one (using Nevertheless, I can switch it for a modal. |
|
You can see here that it's using the |
I can update it to the desired behaviour, I'm just wondering how can it be since they are both using the same way of presentation when one is clearly using The |
@miguelpruivo Ok. Thanks.
Yes, this is what I want actually. Check this |
I'm just surprised of |
Done and published with |
Thanks a lot @miguelpruivo. It is working as expected now. |
Unfortunately this PR will cause the FilePicker to fail and throw an exception if the user just swipes down the modal picker window rather than tapping cancel. To reproduce :
If you encapsulate your code within a try..catch .. you will see the exception that is raised : PlatformException: Multiple requests. Cancelled by a second request. Sample code
The only solution if we still want to keep this new way of showing the modal dialog is to always do a :
Prior to showing the dialog but then we loose the benefits of caching. |
@MsXam I might have to reset after dismissing. I’ll take a look. |
@MsXam I have this also - do you have a fix for this ? |
This has now been fixed with 4.1.1. Thank you all. |
This seems to be the case on Android still, I'm loading files the same way as listed above and I'm on ^4.2.7. Upon calling pickFiles the AppState goes into paused, and upon returning becomes resumes. |
Describe the bug
The image picker or the document picker on iOS opens in new window and moves the app to inactive state and upon selecting the file it moves the app back to the resume state. The problem here is that I have a banking app which asks for PIN every time the app is resumed and due to this I am not able to implement the functionality. The default ImagePicker open the gallery modally on iOS but it does not support pdf files therefore I used your file_picker but it does not open the gallery and document picker modally.
Platform
Platform OS version
iOS 14.6
How are you picking?
Flutter Version details
The text was updated successfully, but these errors were encountered: