|
|
|
@ -7,6 +7,7 @@ import 'package:path_provider/path_provider.dart'; |
|
|
|
import 'package:wifi_iot/wifi_iot.dart'; |
|
|
|
|
|
|
|
import '../../../core/utils/ftpconnect/ftpconnect.dart'; |
|
|
|
import '../../../data/services/meeting/meeting_upload_service.dart'; |
|
|
|
import 'meeting_home_controller.dart'; |
|
|
|
|
|
|
|
class MeetingConnectController extends GetxController { |
|
|
|
@ -69,7 +70,6 @@ class MeetingConnectController extends GetxController { |
|
|
|
_scanResultsSubscription.cancel(); |
|
|
|
_isScanningSubscription.cancel(); |
|
|
|
_valueReceivedSubscription?.cancel(); |
|
|
|
_ftpConnect?.disconnect(); |
|
|
|
_stopScan(); |
|
|
|
_disconnect(); |
|
|
|
super.onClose(); |
|
|
|
@ -100,6 +100,7 @@ class MeetingConnectController extends GetxController { |
|
|
|
} |
|
|
|
|
|
|
|
Future<void> _disconnect() async { |
|
|
|
_ftpConnect?.disconnect(); |
|
|
|
await WiFiForIoTPlugin.forceWifiUsage(false); |
|
|
|
await WiFiForIoTPlugin.disconnect(); |
|
|
|
await _device?.disconnect(); |
|
|
|
@ -233,10 +234,11 @@ class MeetingConnectController extends GetxController { |
|
|
|
await _downloadFile(totalSize, previousSize, element); |
|
|
|
await _ftpConnect?.deleteFile(element.name); |
|
|
|
} |
|
|
|
await _disconnect(); |
|
|
|
stateStr.value = '下载完成'; |
|
|
|
importedFilesStr.value = '下载完成,共${listDirectory.length}个文件,2秒后自动返回'; |
|
|
|
_disconnect(); |
|
|
|
Future.delayed(const Duration(seconds: 2), () { |
|
|
|
_executeUpload(); |
|
|
|
Get.back(); |
|
|
|
}); |
|
|
|
} |
|
|
|
@ -262,7 +264,17 @@ class MeetingConnectController extends GetxController { |
|
|
|
fileSize.value = size; |
|
|
|
}, |
|
|
|
); |
|
|
|
await _meetingController.insertMeetingAudio(entry.name, filePath); |
|
|
|
await _meetingController.insertMeetingAudio( |
|
|
|
entry.name, |
|
|
|
filePath, |
|
|
|
isUpload: false, |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
Future<void> _executeUpload() async { |
|
|
|
await Future.delayed(const Duration(seconds: 3)); |
|
|
|
final meetingUploadService = Get.find<MeetingUploadService>(); |
|
|
|
meetingUploadService.executeUpload(); |
|
|
|
} |
|
|
|
|
|
|
|
String _decodePassword(List<int> data) { |
|
|
|
|