Skip to content

[file_selector] Add iOS's implementations for getDirectoryPath and getSavePath #111583

Open

Description

@juandausa

Use case

The current implementation of the file_selector plugin has missing features on iOS.

There are other packages available that offer this implementation that can be used as guidance.

Proposal

Add the missing implementations to satisfy the whole interface.

Activity

  1. stuartmorgan-g commented on Sep 14, 2022

    @stuartmorgan-g
    Contributor

    One of your pictures is of the test page for getSavePath. Can you elaborate on what you expect that method to do on iOS?

  2. added
    in triagePresently being triaged by the triage team
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 15, 2022
  3. juandausa commented on Sep 15, 2022

    @juandausa
    Author

    Hi Stuart, thanks for your prompt response. About the second image, I would expect that the plugin let users select a directory, like it does on the other platforms.

    Here is the code that is being invoked on this page:

    Future<String?> getDirectoryPath({
      String? initialDirectory,
      String? confirmButtonText,
    }) async {
      return FileSelectorPlatform.instance.getDirectoryPath(
          initialDirectory: initialDirectory, confirmButtonText: confirmButtonText);
    }

    Thanks,

  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 15, 2022
  5. stuartmorgan-g commented on Sep 15, 2022

    @stuartmorgan-g
    Contributor

    About the second image, I would expect that the plugin let users select a directory

    Yes, but that's getDirectoryPath; I was asking about getSavePath.

  6. juandausa commented on Sep 15, 2022

    @juandausa
    Author

    Hi Stuart, we just want to share the same functionality among all the platforms. We've already verified that the XFile abstraction allows developers to store a file in the device.

    Thanks,

  7. stuartmorgan-g commented on Sep 15, 2022

    @stuartmorgan-g
    Contributor

    we just want to share the same functionality among all the platforms

    I understand that, but we're wrapping OS functionality in file_selector. What is the iOS version of a save dialog that you are proposing wrapping with getSavePath?

    We've already verified that the XFile abstraction allows developers to store a file in the device.

    XFile is an abstraction around files; file_selector is an abstraction around native file selector UI. They are very different layers. getSavePath doesn't save anything, it shows UI that allows someone to choose where to save something. I'm trying to understand what you are proposing that UI be on iOS.

  8. juandausa commented on Sep 16, 2022

    @juandausa
    Author

    Hi, please correct me if I'm wrong but, I would propose opening the file selector just to pick a folder, pretty similar to what getDirectoryPath will do.

    Thanks,

  9. stuartmorgan-g commented on Sep 16, 2022

    @stuartmorgan-g
    Contributor

    getSavePath returns a file, not a directory, so that would have the wrong semantics.

    I'm not aware of any iOS analog to a save dialog, and it sounds like you aren't either, so I'm still not clear on why you believe that the lack of implementation of getSavePath is a bug.

  10. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 19, 2022
  11. juandausa commented on Sep 21, 2022

    @juandausa
    Author

    Hi Stuart,
    Thanks for the clarification, now I have a better understanding of your concern. We explored other packages and found inspiration in this one called flutter_file_dialog. It allows users to select a folder where the file is going to be saved.

    The current code of the flutter_file_dialog doesn't match one-to-one with the file_selector implementation but, it offers a great starting point for developers.

    What do you think of offering a UI like this one?

  12. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 21, 2022
  13. stuartmorgan-g commented on Sep 21, 2022

    @stuartmorgan-g
    Contributor

    I'm not clear on what that UI is exactly. What component is that displaying?

  14. juandausa commented on Sep 21, 2022

    @juandausa
    Author

    Hi Stuart,
    It is relying on an UIDocumentPickerViewController.

  15. 3 remaining items

  16. changed the title [-]Missing iOS's implementations[/-] [+][file_selector] Add iOS's implementations for getDirectoryPath and getSavePath[/+] on Sep 27, 2022
  17. juandausa commented on Sep 27, 2022

    @juandausa
    Author

    Hi @huycozy, that's correct. Thanks!

  18. added
    P3Issues that are less important to the Flutter project
    on Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterp: file_selectorThe file_selector pluginpackageflutter/packages repository. See also p: labels.platform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions