fdp 1 year ago
parent
commit
9991a64dbc
  1. 18
      lib/modules/meeting/views/meeting_view.dart
  2. 26
      local_plugins/ota/android/src/main/kotlin/com/example/ota/OtaPlugin.kt

18
lib/modules/meeting/views/meeting_view.dart

@ -562,11 +562,12 @@ class MeetingView extends GetView<MeetingController> {
icon: Image.asset('assets/images/explore.png', icon: Image.asset('assets/images/explore.png',
width: 32.w, height: 32.w), width: 32.w, height: 32.w),
title: '现场录音', title: '现场录音',
onTap: () { onTap: () async {
Navigator.of(context).pop(); Navigator.of(context).pop();
Get.toNamed(Routes.meetingRecord, arguments: { await Get.toNamed(Routes.meetingRecord, arguments: {
'audioTypes': 0, 'audioTypes': 0,
}); });
controller.addMeetingAudio();
// TODO: 实现从文件导入逻辑 // TODO: 实现从文件导入逻辑
}, },
), ),
@ -577,12 +578,12 @@ class MeetingView extends GetView<MeetingController> {
icon: Image.asset('assets/images/explore.png', icon: Image.asset('assets/images/explore.png',
width: 32.w, height: 32.w), width: 32.w, height: 32.w),
title: '音、视频录音', title: '音、视频录音',
onTap: () { onTap: () async {
Navigator.of(context).pop(); Navigator.of(context).pop();
Get.toNamed(Routes.meetingRecord, arguments: { await Get.toNamed(Routes.meetingRecord, arguments: {
'audioTypes': 1, 'audioTypes': 1,
}); });
controller.addMeetingAudio();
// TODO: 实现从相册导入逻辑 // TODO: 实现从相册导入逻辑
}, },
), ),
@ -604,11 +605,14 @@ class MeetingView extends GetView<MeetingController> {
], ],
), ),
title: '通话录音', title: '通话录音',
onTap: () { onTap: () async {
Navigator.of(context).pop(); Navigator.of(context).pop();
Get.toNamed(Routes.meetingRecord, arguments: {
await Get.toNamed(Routes.meetingRecord, arguments: {
'audioTypes': 2, 'audioTypes': 2,
}); });
controller.addMeetingAudio();
// TODO: 实现从其他APP导入逻辑 // TODO: 实现从其他APP导入逻辑
}, },
), ),

26
local_plugins/ota/android/src/main/kotlin/com/example/ota/OtaPlugin.kt

@ -268,7 +268,14 @@ class OtaPlugin : BleService.Callback, FlutterPlugin, MethodCallHandler {
streamSink = null streamSink = null
} }
}) })
// 初始化 otaManager 和 bluetoothHelper
}
override fun onMethodCall(call: MethodCall, result: Result) {
if (call.method == "init") {
// 初始化 otaManager 和 bluetoothHelper
ConfigHelper.initialize(context) ConfigHelper.initialize(context)
otaManager = OTAManager(context) otaManager = OTAManager(context)
bluetoothHelper = BluetoothHelper(context) bluetoothHelper = BluetoothHelper(context)
@ -289,11 +296,9 @@ class OtaPlugin : BleService.Callback, FlutterPlugin, MethodCallHandler {
} }
Log.i("TAG", "onAttachedToEngine") Log.i("TAG", "onAttachedToEngine")
result.success("")
} }
else if (call.method == "startUpgrading") {
override fun onMethodCall(call: MethodCall, result: Result) {
if (call.method == "startUpgrading") {
Log.d("TAG", "startUpgrading") Log.d("TAG", "startUpgrading")
// 接收传入的参数 // 接收传入的参数
val arguments = call.arguments as? Map<String, Any> val arguments = call.arguments as? Map<String, Any>
@ -326,13 +331,16 @@ class OtaPlugin : BleService.Callback, FlutterPlugin, MethodCallHandler {
BleService.isEnterOta = false BleService.isEnterOta = false
} }
result.success("")
} else if (call.method == "onOtaClose") { } else if (call.method == "onOtaClose") {
BleService.isEnterOta = false BleService.isEnterOta = false
isDisconnect = false isDisconnect = false
otaManager.bluetoothHelper.stopScan() otaManager?.bluetoothHelper?.stopScan()
otaManager.bluetoothHelper.disconnectDevice(otaDevice)
otaManager?.bluetoothHelper?.disconnectDevice(otaDevice)
result.success("")
} else { } else {
result.notImplemented() result.notImplemented()
} }

Loading…
Cancel
Save