dart proxy for easyrtc: type 'JsObject' is not a subtype of type 'JsFunction'

StackOverflow https://stackoverflow.com/questions/23687901

  •  23-07-2023
  •  | 
  •  

Frage

I'm experimenting some with easyrtc using dart. Following this the file would be something like this:

import 'dart:html';
import 'package:js/js.dart' as js;

var selfEasyrtcid = "";
var easyrtc;

void main() {
  easyrtc = new js.Proxy(js.context.easyrtc);
}

void something(){
  easyrtc.someFunction();
}

but when I try to run that in dartium it crashes with:

Exception: type 'JsObject' is not a subtype of type 'JsFunction' of 'constructor'. (package:js/js.dart:168) Breaking on exception: type 'JsObject' is not a subtype of type 'JsFunction' of 'constructor'.

What am I doing wrong here?

War es hilfreich?

Lösung

According to the doc you don't need to call new JsObject that should be used to do new xxx on JS side. Simply do :

easyrtc = js.context.easyrtc;
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top