-
-
Notifications
You must be signed in to change notification settings - Fork 962
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
[Request]: (share_plus) Migrate to package:web
to support WASM
#2603
Comments
package:web
to support WASMpackage:web
to support WASM
2 weeks and nothing. What is taking so long?????? |
In case you need this change urgently, you can also run a local fork with your changes. If you do, please consider submitting a PR with the change and your findings. |
This is an open source project, so you are more than welcome to do this yourself. Otherwise you can't demand anything from people who support packages in their free time. |
Trying to work on this issue, however, I'm not getting any leads to initialize the navigator and how to use the share method, if anyone has an idea please let me know. thanks |
Do you have a fork/branch somewhere @muhib349 to have a look? |
Yes, you can have a look on this branch, |
@muhib349 you used the correct navigator, however it seems like the What you could do is instead of relying on the This is how it's written in the It could look a bit like: import 'dart:js_interop';
extension type Navigator._(JSObject _) implements JSObject {
# todo: Use correct return type and parameters :)
external void share();
} Then you can use that custom Navigator class and call it just like it would exist. You might be required to set the minimum Dart Version to 3.3 though to use those new Extension Types I hope this helps. |
Yes, this helps a lot! Keep in mind that the original Also, a similar solution was discussed here for the missing And just for reference: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share Finally, probably also worth opening a ticket on the |
Thanks a lot, @IchordeDionysos and @miquelbeltran. Meanwhile, I'm trying to implement. |
Well I gave it a go, but I am unable to make it work. As extension function I defined this one, which I think matches the JS spec. Although I have no idea if this is correct or not. extension on html.Navigator {
external JSPromise share([JSObject? data]);
} The problem I have also is that I don't know is how to properly convert a Another thing I couldn't figure out is how to create a I honestly have no idea how to move this forward. My wip branch is pushed in this repo as |
Plugin
share_plus
Use case
Compiling to WASM
Proposal
The short version:
Migrate usage of dart:html to package:web
Migrate usage of dart:js, dart:js_util, and package:js to dart:js_interop
This will allow compiling to WASM engine instead of just JavaScript on web.
Full migration guide: https://dart.dev/interop/js-interop/package-web
The text was updated successfully, but these errors were encountered: