Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web not running onFileLoading #766

Closed
1 task done
tuantvu opened this issue Jul 12, 2021 · 4 comments
Closed
1 task done

Web not running onFileLoading #766

tuantvu opened this issue Jul 12, 2021 · 4 comments
Labels
improvement Improvement needed on a specific feature web Issue applies to Web platform

Comments

@tuantvu
Copy link

tuantvu commented Jul 12, 2021

Describe the bug
I've put print, log, and break points inside of onFileLoading while using Flutter Web, but it is not triggering, similar to this previous issue: #577

Platform

  • [] Android
  • [] iOS
  • Web
  • [] Desktop (Go)

Platform OS version
Chrome Version 91.0.4472.114 (Official Build) (x86_64)

How are you picking?

FilePickerResult? result = await FilePicker.platform.pickFiles(
  type: FileType.image,
  onFileLoading: (status) {
    if (status == FilePickerStatus.done) {
      print('FilePickerStatus: $status');
      onDone?.call();
    }
  },
);

Details to reproduce the issue
Include the snippet above in Flutter Web

Error Log
N/A

Screenshots and/or video
N/A

Flutter Version details

flutter doctor -v
[✓] Flutter (Channel stable, 2.2.2, on macOS 11.4 20F71 darwin-x64, locale en-US)
    • Flutter version 2.2.2 at /Applications/Flutter/beta
    • Framework revision d79295af24 (4 weeks ago), 2021-06-11 08:56:01 -0700
    • Engine revision 91c9fc8fe0
    • Dart version 2.13.3

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/tuan/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Users/tuan/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.57.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.23.0

[✓] Connected device (2 available)
    • iPhone 12 Pro Max (mobile) • B0EA2CAC-293B-4D67-AB86-C903451C1060 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 91.0.4472.114

Additional context
N/A

@tuantvu tuantvu added the new issue An issue that hasn't yet been seen from the maintainer label Jul 12, 2021
@miguelpruivo
Copy link
Owner

@tuantvu I do think that files are instantly loaded as blobs whenever picked hence the reason why there aren’t any events.

Could you please elaborate your use case?

Thank you!

@miguelpruivo miguelpruivo added triage Further information is requested web Issue applies to Web platform and removed new issue An issue that hasn't yet been seen from the maintainer labels Jul 20, 2021
@tuantvu
Copy link
Author

tuantvu commented Jul 20, 2021

When the user picks a large image, like 9 mb, it takes awhile to load and looks like nothing is happening on the page. I'd like to show a progress indicator during this time. Knowing when the file is loading and done loading helps. Maybe, even if the load is instant, that callback should fire with status is done? Right now, that callback is never fired.

@miguelpruivo
Copy link
Owner

I'll see what I can do.

@miguelpruivo
Copy link
Owner

Implemented and published with 4.0.0. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement needed on a specific feature web Issue applies to Web platform
Projects
None yet
Development

No branches or pull requests

2 participants