google / flutter-desktop-embedding

Experimental plugins for Flutter for Desktop
Apache License 2.0
7.1k stars 607 forks source link

[file_selector_windows] Save file dialog does not populate with initial filename and filter(s). #849

Closed andrewmk closed 3 years ago

andrewmk commented 3 years ago

Creating a 'file save' dialog on Windows using the file_selector_windows plugin doesn't populate the filename part of the dialog with the suggested filename and doesn't populate anything into the filters drop down (it's empty). This happens in my custom app but also in the example app provided at https://github.com/google/flutter-desktop-embedding/tree/master/plugins/file_selector/example as at commit 7daa15e90672542f730ec871b1a6e84a5b7b8f3c. I see a similar sounding issue #842 with file_selector_macos was closed recently with the comment that the problem was not with file_selector_macos. If this current problem is not with file_selector_windows I'd be happy to try to diagnose where the problem is if someone could give me some pointers.

image

image (1)

Doctor Output

$ flutter doctor -v
[√] Flutter (Channel stable, 2.0.2, on Microsoft Windows [Version 10.0.19041.867], locale en-GB)
    • Flutter version 2.0.2 at C:\apps\flutter
    • Framework revision 8962f6dc68 (4 weeks ago), 2021-03-11 13:22:20 -0800
    • Engine revision 5d8bf811b3
    • Dart version 2.12.1

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
    • Android SDK at C:\Users\user\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.1
    • Java binary at: C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe
    • Java version Java(TM) SE Runtime Environment (build 1.8.0_281-b09)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.6.3)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.6.30225.117
    • Windows 10 SDK version 10.0.18362.0

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[√] IntelliJ IDEA Ultimate Edition (version 2017.3)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.3
    • 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

[√] VS Code, 32-bit edition (version 1.46.1)
    • VS Code at C:\Program Files (x86)\Microsoft VS Code
    • Flutter extension version 3.12.2

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19041.867]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 89.0.4389.114
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 85.0.564.51

! Doctor found issues in 1 category.
stuartmorgan commented 3 years ago

Creating a 'file save' dialog on Windows using the file_selector_windows plugin doesn't populate the filename part of the dialog with the suggested filename and doesn't populate anything into the filters drop down (it's empty).

I'm not able to reproduce this; please provide your Dart code.

This happens in my custom app but also in the example app provided at https://github.com/google/flutter-desktop-embedding/tree/master/plugins/file_selector/example as at commit 7daa15e.

You've shown a screenshot of a dialog in the example that doesn't pass a filename (which is a bug in the example) or filter, so those images are the expected result of the code in the example.

I see a similar sounding issue #842 with file_selector_macos was closed recently with the comment that the problem was not with file_selector_macos

That was an issue with the use of cross_file and had nothing to do with the dialogs, so I'm not sure what similarity you're referring to.

andrewmk commented 3 years ago

Thank you. With your fixed example I was able to see what I wasn't understanding about the API and what to change to make my app work properly.