UnityWebController constructor

UnityWebController({
  1. required dynamic listenMessageFromUnity(
    1. String data
    ),
})

Implementation

UnityWebController({required Function(String data) listenMessageFromUnity}) {
  html.window.addEventListener('message', (event) {
    listenMessageFromUnity((event as html.MessageEvent).data.toString());

    refreshUnityView();
  });
}