plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

fix(device_info_plus): fix type casting for WASM

Open GiacomoPignoni opened this issue 1 year ago • 3 comments

Description

Fix some types casting on web implementation for WASM compilation

Related Issues

  • FIX #2966

Checklist

  • [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • [x] I titled the PR using Conventional Commits.
  • [x] I did not modify the CHANGELOG.md nor the plugin version in pubspec.yaml files.
  • [x] All existing and new tests are passing.
  • [x] The analyzer (flutter analyze) does not report any problems on my PR.

GiacomoPignoni avatar Aug 09 '24 12:08 GiacomoPignoni

FIX https://github.com/fluttercommunity/plus_plugins/issues/2966

The mentioned issue is about package_info_plus, while your changes are for device_info_plus.

Could you explain why you did the change in this PR? device_info_plus supports a range of web versions https://github.com/fluttercommunity/plus_plugins/blob/main/packages/device_info_plus/device_info_plus/pubspec.yaml#L40 and works well with both web 0.5.1 and 1.0.0 at the moment.

vbuberen avatar Aug 09 '24 12:08 vbuberen

I'm sorry,I got confused, I did notice the PR was for package_info_plus: Still that the package device_info_plus, the one I'm fixing in this PR, has a similar problem when used in web compiled in WASM.

  • The type of deviceMemory came out as a double on WASM
  • The languages field it's a JSArray<JSString> so it needs to pass through toDart

GiacomoPignoni avatar Aug 09 '24 15:08 GiacomoPignoni

Still that the package device_info_plus, the one I'm fixing in this PR, has a similar problem when used in web compiled in WASM.

I would ask you to open the issue first and fill in all the required data, because from just this statement it is not clear in which environment, which versions you used etc. As I mentioned we check WASM compilation as well and everything worked fine so far. So if you found an issue, it would be better to report is properly first, so we could have a constructive discussion about this PR.

vbuberen avatar Aug 09 '24 15:08 vbuberen

The changes in this PR are the same as https://github.com/fluttercommunity/plus_plugins/pull/3254

Let's follow up on that other PR, I will close this one.

In all cases, thanks for the contribution @GiacomoPignoni !

miquelbeltran avatar Oct 01 '24 09:10 miquelbeltran