Yes you are doing it basically wrong, but I wouldn't blame you since even the IDE seems to do it the way you are doing it!
Here's how to do it properly:
import 'dart:html';
void main() {
window.webkitRequestFileSystem(LocalWindow.TEMPORARY, 50*1024*1024, (DOMFileSystem fs) {
fs.root.getFile('log.txt', options: {'create': true}, successCallback: (FileEntry e) {
print(e.fullPath);
});
});
}
It uses named parameters and the signature for getFile
is:
void getFile(String path, {Map options, EntryCallback successCallback, ErrorCallback errorCallback});
So, if you look carefully, the first parameter is compulsory, but the rest aren't and in fact can be specified in any order as long as you specify them by their names.
If you are still confused, read about the named parameters.