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

[image_picker_for_web] migrates to package:web #5799

Merged

Conversation

balvinderz
Copy link
Contributor

@balvinderz balvinderz commented Jan 4, 2024

Updates the web implementation of image_picker_for_web to package:web.

Issues

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Copy link
Member

@ditman ditman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PTAL @tarrinneal, I think I addressed all my own concerns haha!

@ditman
Copy link
Member

ditman commented Feb 29, 2024

(I tried compiling the example app to Wasm, but it depends on video_player, which isn't migrated yet. All the errors happen in that package, which I'll finish migrating next)

@ditman ditman requested a review from kevmoo March 5, 2024 22:46
/// Converts a [web.FileList] into a [List] of [web.File].
///
/// This method makes a copy.
List<web.File> get toList =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meh...I'd opt for a function here. But maybe that's just my preference.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope this eventually gets provided by package:web, as some form of iterable thing, so I don't need any of my code :P

final Completer<List<XFile>> completer = Completer<List<XFile>>();
// Observe the input until we can return something
input.onChange.first.then((html.Event event) {
final List<html.File>? files = _handleOnChangeEvent(event);
input.onchange = (web.Event event) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the streams, not the listeners directly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created an issue for this, the onCancel stream doesn't exist and seems that cannot be easily created: dart-lang/web#199

Copy link
Member

@ditman ditman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding 2nd approval.

@ditman ditman added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 6, 2024
@auto-submit auto-submit bot merged commit 9b88dbc into flutter:main Mar 6, 2024
78 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 6, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Mar 6, 2024
flutter/packages@2aa6e3f...9b88dbc

2024-03-06 balvindersi2@gmail.com [image_picker_for_web] migrates to package:web (flutter/packages#5799)
2024-03-06 balvindersi2@gmail.com [video_player_web] migrates to package:web (flutter/packages#5800)
2024-03-06 49699333+dependabot[bot]@users.noreply.github.com [in_app_pur]: Bump org.json:json from 20240205 to 20240303 in /packages/in_app_purchase/in_app_purchase/example/android/app (flutter/packages#6253)
2024-03-05 ian@hixie.ch [rfw] Change test coverage logic to enforce 100% coverage (flutter/packages#6272)
2024-03-05 louisehsu@google.com [in_app_purchase_storekit] backfill native tests for more complete test coverage (flutter/packages#6209)
2024-03-05 stuartmorgan@google.com [tool] Add features to support GCB auto-publish flow (flutter/packages#6218)
2024-03-05 ditman@gmail.com [web] Use TrustedTypes from pkg web. (flutter/packages#6273)
2024-03-05 engine-flutter-autoroll@skia.org Roll Flutter from 65cd84b to 3b5a2ec (26 revisions) (flutter/packages#6269)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
LouiseHsu pushed a commit to LouiseHsu/packages that referenced this pull request Mar 7, 2024
Updates the web implementation of `image_picker_for_web` to `package:web`.

### Issues

* Fixes flutter/flutter#139751
arc-yong pushed a commit to Arctuition/packages-arc that referenced this pull request Jun 14, 2024
Updates the web implementation of `image_picker_for_web` to `package:web`.

### Issues

* Fixes flutter/flutter#139751
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: image_picker platform-web
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[image_picker] migrate to pkg:web
5 participants