dart-gde/chrome.dart

fileSystem.chooseEntry return null when acceptsMultiple is set

Vloz opened this issue · 1 comments

Vloz commented

When i specify acceptsMultiple to false in the ChooseEntryOptions, the ChooseEntryResult properties are always null:

chrome.fileSystem.chooseEntry(
        new chrome.ChooseEntryOptions(acceptsMultiple:false)).then((result){
          print(result.entry);                //always null
          print(result.fileEntries);        //always null 
        });

(everything works fine when i don't set the acceptsMultiple)

I am maybe doing a wrong use of fileSystem, if so, i m sorry.

EDIT: Same thing when acceptsMultiple is set to true:
http://stackoverflow.com/questions/23564421/selecting-multiple-files-in-a-dart-based-chrome-app

I ran into this issue also; I dug into it a bit and found the following:

The issue here appears to be that the chooseEntry callback is generated to use the twoArgs flavor of ChromeCompleter, which is expecting the list of file entries as arg2. However, when acceptsMultiple is true the list of file entries arrives as the first and only callback argument, arg1. We can see in the IDL for EntriesCallback that both arguments are optional and what is happening is that you get one or the other, whereas the generated code expects the first argument to be there in order to get the second.

I could fix the generated code, but I'm not sure where to start in terms of fixing the parser / code generator...