1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] You must specify "rootDirectory" or "shortcuts", but not both

Discussão em 'Mobile' iniciado por Stack, Novembro 9, 2024 às 19:32.

  1. Stack

    Stack Membro Participativo

    I am using Dart/Flutter on Windows.

    I am using File System Picker and File Picker Windows.

    I need to select a folder and return the folder full path.

    My steps are:

    1. Ask a user to select a folder
    2. I get the popup to select a folder
    3. The problem is that the folder path variable is still null after the folder selection.

    Plus, If I don't select a folder and click Cancel on the folder selection popup, then I get this error: You must specify "rootDirectory" or "shortcuts", but not both

    Could you please help. Thank You

    Here is my code:

    myfolderSelectFunction() {
    final m = DirectoryPicker()..title = 'Select a directory';
    final result = m.getDirectory();
    FilesystemPicker(rootDirectory: result, fsType: FilesystemType.all, onSelect: (String value) {
    myFolderpath = value;
    });
    return myFolderpath;
    }

    Continue reading...

Compartilhe esta Página