diff --git a/lib/modules/meeting/views/meeting_view.dart b/lib/modules/meeting/views/meeting_view.dart index d7891456c..83414157b 100644 --- a/lib/modules/meeting/views/meeting_view.dart +++ b/lib/modules/meeting/views/meeting_view.dart @@ -562,11 +562,12 @@ class MeetingView extends GetView { icon: Image.asset('assets/images/explore.png', width: 32.w, height: 32.w), title: '现场录音', - onTap: () { + onTap: () async { Navigator.of(context).pop(); - Get.toNamed(Routes.meetingRecord, arguments: { + await Get.toNamed(Routes.meetingRecord, arguments: { 'audioTypes': 0, }); + controller.addMeetingAudio(); // TODO: 实现从文件导入逻辑 }, ), @@ -577,12 +578,12 @@ class MeetingView extends GetView { icon: Image.asset('assets/images/explore.png', width: 32.w, height: 32.w), title: '音、视频录音', - onTap: () { + onTap: () async { Navigator.of(context).pop(); - Get.toNamed(Routes.meetingRecord, arguments: { + await Get.toNamed(Routes.meetingRecord, arguments: { 'audioTypes': 1, }); - + controller.addMeetingAudio(); // TODO: 实现从相册导入逻辑 }, ), @@ -604,11 +605,14 @@ class MeetingView extends GetView { ], ), title: '通话录音', - onTap: () { + onTap: () async { Navigator.of(context).pop(); - Get.toNamed(Routes.meetingRecord, arguments: { + + await Get.toNamed(Routes.meetingRecord, arguments: { 'audioTypes': 2, }); + controller.addMeetingAudio(); + // TODO: 实现从其他APP导入逻辑 }, ), diff --git a/local_plugins/ota/android/src/main/kotlin/com/example/ota/OtaPlugin.kt b/local_plugins/ota/android/src/main/kotlin/com/example/ota/OtaPlugin.kt index 65bf3ba88..3b34cf9cd 100644 --- a/local_plugins/ota/android/src/main/kotlin/com/example/ota/OtaPlugin.kt +++ b/local_plugins/ota/android/src/main/kotlin/com/example/ota/OtaPlugin.kt @@ -268,7 +268,14 @@ class OtaPlugin : BleService.Callback, FlutterPlugin, MethodCallHandler { streamSink = null } }) - // 初始化 otaManager 和 bluetoothHelper + + + } + + override fun onMethodCall(call: MethodCall, result: Result) { + if (call.method == "init") { + + // 初始化 otaManager 和 bluetoothHelper ConfigHelper.initialize(context) otaManager = OTAManager(context) bluetoothHelper = BluetoothHelper(context) @@ -289,11 +296,9 @@ class OtaPlugin : BleService.Callback, FlutterPlugin, MethodCallHandler { } Log.i("TAG", "onAttachedToEngine") - - } - - override fun onMethodCall(call: MethodCall, result: Result) { - if (call.method == "startUpgrading") { + result.success("") + } + else if (call.method == "startUpgrading") { Log.d("TAG", "startUpgrading") // 接收传入的参数 val arguments = call.arguments as? Map @@ -326,13 +331,16 @@ class OtaPlugin : BleService.Callback, FlutterPlugin, MethodCallHandler { BleService.isEnterOta = false } - + result.success("") } else if (call.method == "onOtaClose") { BleService.isEnterOta = false isDisconnect = false - otaManager.bluetoothHelper.stopScan() - otaManager.bluetoothHelper.disconnectDevice(otaDevice) + otaManager?.bluetoothHelper?.stopScan() + + otaManager?.bluetoothHelper?.disconnectDevice(otaDevice) + + result.success("") } else { result.notImplemented() }