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