Closed
Description
- Dart SDK Version 2.1.0
- Windows
- Chrome
When compiled with web serve, it throws an exception that says "Type 'NativeJavaScriptObject' is not a subtype of expected type 'Entry'."
When compiled with dart2js it works as expected.
Here's a sample of the code i'm using:
void main() {
fileDivElement.onDrop.listen(_onFilesDrop);
}
void _onFilesDrop(MouseEvent event) async {
event.stopPropagation();
event.preventDefault();
List<Entry> items = List<Entry>();
for(int i=0; i<event.dataTransfer.items.length; i++) {
// ------------------- This is where it dies --------------------- //
items.add(event.dataTransfer.items[i].getAsEntry());
}
_processFiles(items);
}