flutter-plugins icon indicating copy to clipboard operation
flutter-plugins copied to clipboard

[desktop_drop] Not working when build web release

Open nk4n01 opened this issue 1 year ago • 6 comments

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:

  1. flutter build web --web-renderer html --release

Expected behavior

A clear and concise description of what you expected to happen.

Screenshot 2023-02-28 at 13 12 55

Version (please complete the following information):

  • Flutter Version: v3.7.0
  • OS: Chrome for mac
  • plugin: desktop_drop: 0.4.1

nk4n01 avatar Feb 28 '23 06:02 nk4n01

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.

image

Does the example works on your device? or can you provider an reproducable example?

boyan01 avatar Feb 28 '23 08:02 boyan01

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, ), ),

nk4n01 avatar Mar 01 '23 03:03 nk4n01

I can reproduce that bug in my environment.

shinpeiyamagiwa avatar Jul 17 '23 08:07 shinpeiyamagiwa

@boyan01 @nk4n01 I'm using flutter: v3.7.0, desktop_drop: v0.4.1

shinpeiyamagiwa avatar Jul 17 '23 08:07 shinpeiyamagiwa

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.

TiffApps avatar Aug 17 '23 14:08 TiffApps

Had a similar issue that I resolved by running 'flutter clean'

Rimzone avatar Jan 06 '24 08:01 Rimzone