TPListenerCenter constructor

TPListenerCenter()

Implementation

TPListenerCenter() {
  TradplusSdk.eventChannel.receiveBroadcastStream().listen((event) {
    // 处理来自原生的事件
    String method = event["method"];
    Map data = event["data"];
    print('Received event: $method,data=$data');
    tpMethodCall(method, data);
  });
  TradplusSdk.channel.setMethodCallHandler((MethodCall call) async {
    String method = call.method;
    tpMethodCall(method, call.arguments);
  });
}