Skip to content

Add support for WebAssemly (WASM). #1030

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

Merged
merged 2 commits into from
Aug 3, 2025
Merged

Conversation

timbotimbo2
Copy link
Contributor

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 to package: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 version 0.5.x or 1.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.

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@timbotimbo timbotimbo merged commit 1660214 into juicycleff:master Aug 3, 2025
2 checks passed
@timbotimbo timbotimbo deleted the wasm-v2 branch August 4, 2025 12:19
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.

2 participants