miguelpruivo / flutter_file_picker

File picker plugin for Flutter, compatible with mobile (iOS & Android), Web, Desktop (Mac, Linux, Windows) platforms with Flutter Go support.
MIT License
1.32k stars 653 forks source link

FilePicker.platform.saveFile will execute the save operation before clicking the save button #1580

Closed xiaoqiaowoai closed 1 week ago

xiaoqiaowoai commented 1 month ago

Describe the bug When I set UISupportsDocumentBrowser is true on info.plist, FilePicker.platform.saveFile will execute the save operation before clicking the save button

Platform

Platform OS version iOS17.5

How are you picking?

String? outputFile = await FilePicker.platform.saveFile(
                               dialogTitle:'Please select an open directory:',
                               fileName:"${dateTime.year}-${dateTime.month}-${dateTime.day}-${dateTime.hour}-${dateTime.minute}-${dateTime.second}.png",
                               bytes: rosProvider.cameraRawImg);

Details to reproduce the issue I set UISupportsDocumentBrowser as true on info.plist, and I want to save some files in the file manager app folder(like the file_picker_example folder in the first Screenshot ). However, I found that FilePicker.platform.saveFile will execute the save operation before clicking the save button. I also found the same problem in the example provided by flutter_file_picker(like the second Screenshot). Error Log no error.

Screenshots and/or video

截屏2024-08-14 17 19 37

录屏2024-08-14-17 18 16 As the picture shows, FilePicker.platform.saveFile will execute the save operation before clicking the save button. In my app, FilePicker.platform.saveFile will save the bytedata(I set it as rosProvider.cameraRawImg, rosProvider.cameraRawImg is an image bytedata) before I click the save button.

Flutter Version details [✓] Flutter (Channel stable, 3.22.2, on macOS 14.5 23F79 darwin-arm64, locale zh-Hans-CN) • Flutter version 3.22.2 on channel stable at /Users/username/Documents/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 761747bfc5 (2 months ago), 2024-06-05 22:15:13 +0200 • Engine revision edd8546116 • Dart version 3.4.3 • DevTools version 2.34.3 • Pub download mirror https://pub.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) • Android SDK at /Users/username/Library/Android/sdk • Platform android-35, build-tools 35.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15F31d • CocoaPods version 1.15.2

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)

[✓] VS Code (version 1.92.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.94.0

github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open for 7 days with no activity.

github-actions[bot] commented 1 week ago

This issue was closed because it has been inactive for 14 days since being marked as stale.