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

WASM support for Flutter web #1481

Merged
merged 9 commits into from
Apr 18, 2024
Merged

Conversation

amrgetment
Copy link
Contributor

Adding WASM support to close
#1480

Test by Flutter Beta channel or master channel and build by the following command
flutter build web --wasm

Copy link

@IchordeDionysos IchordeDionysos left a comment

Choose a reason for hiding this comment

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

Apart from the import it looks good!

Thanks for the PR 😍

pubspec.yaml Outdated
@@ -17,6 +17,8 @@ dependencies:
path: ^1.8.2
win32: ^5.1.1
cross_file: ^0.3.3+7
js: ^0.7.1

Choose a reason for hiding this comment

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

Is that intended?
It's not used anymore and doesn't work with WASM anyways :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is a mistake, I removed it I don’t use it anyway
thanks

@amrgetment
Copy link
Contributor Author

@IchordeDionysos You have to be a team member of this project to pass CI approval requirements 😁
Thanks for approval 😍🎯

@IchordeDionysos
Copy link

Yeah true :D But given I've looked over it, I figured it can't hurt :P

Copy link
Collaborator

@navaronbracke navaronbracke left a comment

Choose a reason for hiding this comment

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

Some minor remarks

@@ -58,7 +60,9 @@ class FilePickerWeb extends FilePicker {
Completer<List<PlatformFile>?>();

String accept = _fileType(type, allowedExtensions);
InputElement uploadInput = FileUploadInputElement() as InputElement;
HTMLInputElement uploadInput =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
HTMLInputElement uploadInput =
HTMLInputElement uploadInput = HTMLInputElement();

The constructor calls document.createElement under the hood.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

refactored

@@ -101,7 +105,12 @@ class FilePickerWeb extends FilePicker {
}
}

for (File file in files) {
for (var i = 0; i < files.length; i++) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
for (var i = 0; i < files.length; i++) {
for (int i = 0; i < files.length; i++) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

refactored


//Add input element to the page body
_target.children.clear();
var firstChild = _target.firstChild;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd prefer to use the real type instead of var here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

refactored

@amrgetment
Copy link
Contributor Author

I added the change requests

@navaronbracke navaronbracke merged commit 05af933 into miguelpruivo:master Apr 18, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants