Add support for WebAssemly (WASM). #1030
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a retry of #1028, which ran into an outdated github action workflow.
Description
This PR adds WebAssemly (Wasm) support to the web platform, which was requested here #989.
Since Flutter 3.24 it supports 2 build modes on web, default and WebAssembly.
WebAssembly doesn't support the
dart:html
library that is used in this plugin.dart:html
needs to be switched topackage:web
.This
web
package also supports the classic default mode for web, which means this switch is not a breaking change.However the lowest compatible
web
package requires Flutter 3.16 and Dart 3.2.This PR raises the minimum version of flutter_unity_widget to Flutter 3.16 and Dart 3.2.
To actually run this plugin with WebAssembly,
web
needs to be resolved to version0.5.x
or1.x.y
.I've set the dependency in pubspec.yaml to
>=0.3.0 < 2.0.0
.This is to keep support for lower Flutter versions without WebAssembly, down to Flutter 3.16.
Just a small note:
In my testing,
pointer_interceptor
which is needed to stack UI on top of the webview, will only work in WebAssembly mode when the minimum dart sdk of your project is 2.17 or higher.Type of Change
Most Flutter versions do not mark upgrading the minimum Flutter version as a breaking change.