BehaviorSubject openCameraController = BehaviorSubject(); BridgeChannel _openCamera() { print( ‘- - - - - - - - - - - - - - - - - - _openCamera() ‘ ); return BridgeChannel( name: ‘openCamera‘ , onBridgeHandler: (dataFromJs) async {
BehaviorSubject openCameraController = BehaviorSubject(); BridgeChannel _openCamera() { print(‘- - - - - - - - - - - - - - - - - - > _openCamera() ‘); return BridgeChannel( name: ‘openCamera‘, onBridgeHandler: (dataFromJs) async { print(‘- - - - - - - - - - - - - - - - - - > _openCamera() 发送事件 ‘+dataFromJs); EventBus().post(OpenCameraEvent(dataFromJs)); print(‘- - - - - - - - - - - - - - - - - -222 > openCameraController.listen2 ‘); return await doSome(); } ); } Future<String> doSome() async { var a = new Future(() => null); openCameraController.listen((resul) { print(‘- - - - - - - - - - - - - - - - - - > openCameraController.listen ‘+resul); //return result = resul; //call(‘dart2Js‘, resul); a.then((_) => resul); }); return a; }