flutter-plugins
flutter-plugins copied to clipboard
[desktop_drop] Not working when build web release
I'm using desktop_drop for flutter web It's good when developed, but when I build a release version, it's not working. I try to drag and drop an image and it just open a new tab.
Reproduce Steps
Steps to reproduce the behavior:
- flutter build web --web-renderer html --release
Expected behavior
A clear and concise description of what you expected to happen.

Version (please complete the following information):
- Flutter Version: v3.7.0
- OS: Chrome for mac
- plugin: desktop_drop: 0.4.1
tried the example on macOS with flowing commands, but didn't reproduced the issue.
cd packages/desktop_drop/example
flutter build web --web-renderer html --release
cd build/web
python3 -m http.server
then open the page by chrome, seems works fine.

Does the example works on your device? or can you provider an reproducable example?
Sorry for my late reply, I found the problem happening not only after the build. When I try to drop an image it's just open in a new tab. I'm using flutter: v3.7.0, desktop_drop: v0.4.1
Here is how I get this issue:
https://drive.google.com/file/d/1dLHLOFO28RCVIJJgqn_92Sp5oTU5cR94/view?usp=sharing
Here is my code:
DropTarget( onDragDone: (detail) async { debugPrint('onDragDone:'); for (final file in detail.files) { debugPrint(' ${file.path} ${file.name}' ' ${await file.lastModified()}' ' ${await file.length()}' ' ${file.mimeType}'); } }, child: Container( height: 200, width: 200, color: kColorBlack, ), ),
I can reproduce that bug in my environment.
@boyan01 @nk4n01 I'm using flutter: v3.7.0, desktop_drop: v0.4.1
Sorry for my late reply, I found the problem happening not only after the build. When I try to drop an image it's just open in a new tab. I'm using flutter: v3.7.0, desktop_drop: v0.4.1 Here is how I get this issue: https://drive.google.com/file/d/1dLHLOFO28RCVIJJgqn_92Sp5oTU5cR94/view?usp=sharing Here is my code:
DropTarget( onDragDone: (detail) async { debugPrint('onDragDone:'); for (final file in detail.files) { debugPrint(' ${file.path} ${file.name}' ' ${await file.lastModified()}' ' ${await file.length()}' ' ${file.mimeType}'); } }, child: Container( height: 200, width: 200, color: kColorBlack, ), ),
Same, with the example from pub.dev, it just opens the file in a new tab.
Had a similar issue that I resolved by running 'flutter clean'