flutter-unity-view-widget icon indicating copy to clipboard operation
flutter-unity-view-widget copied to clipboard

WASM Support

Open lorisgir opened this issue 1 year ago • 3 comments

Describe the bug I'm trying to run the unity player on flutter web with wasm enabled, but it gives me this error: TargetPlatform.macOS is not yer supported by the unity player plugin.

I'm running this from my macbook pro. Is this an expected behaviour?

To Reproduce Steps to reproduce the behavior:

  1. Run on flutter web with --wasm

Expected behavior The player running.

Unity (please complete the following information):

  • OS: MacOS 14.6
  • Version Unity 2022.3.43f1

Smartphone (please complete the following information):

  • Device: Chrome

lorisgir avatar Oct 29 '24 19:10 lorisgir

I tried to run the same code but switching to a windows pc and I got the same error: TargetPlatform.windows is not yer supported by the unity player plugin.

lorisgir avatar Nov 02 '24 16:11 lorisgir

Looks like this conditional breaks as dart.library.html is not available with WASM. https://github.com/juicycleff/flutter-unity-view-widget/blob/f51fedc77007f603c5df68820fcf51d04c32e1d9/lib/flutter_unity_widget.dart#L4-L6

Dart:html is used plenty in web_unity_widget_controller.dart, so this plugin will need the dart:html to package:web migration to work on WASM.

timbotimbo avatar Dec 02 '24 10:12 timbotimbo

There is a PR that adds WASM support here.

If by any chance your are still interested in or still using this plugin, give it a try.

timbotimbo avatar Jul 24 '25 16:07 timbotimbo