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

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

  •  23-07-2023
  •  | 
  •  

문제

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?

도움이 되었습니까?

해결책

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;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top