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

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

  •  23-07-2023
  •  | 
  •  

Pergunta

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?

Foi útil?

Solução

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;
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top