|
|
|
@ -1,7 +1,9 @@ |
|
|
|
import 'dart:async'; |
|
|
|
import 'dart:convert'; |
|
|
|
import 'dart:io'; |
|
|
|
|
|
|
|
import 'package:audio_waveforms/audio_waveforms.dart'; |
|
|
|
import 'package:dio/dio.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter/services.dart' show rootBundle; |
|
|
|
import 'package:flutter_easyloading/flutter_easyloading.dart'; |
|
|
|
@ -9,6 +11,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
import 'package:get/get.dart'; |
|
|
|
import 'package:get_storage/get_storage.dart'; |
|
|
|
import 'package:http/http.dart' as http; |
|
|
|
import 'package:path_provider/path_provider.dart'; |
|
|
|
|
|
|
|
import '../../../core/utils/logger.dart'; |
|
|
|
import '../../../core/utils/synchrodata.dart'; |
|
|
|
@ -58,6 +61,9 @@ class MeetingDetailsController extends GetxController |
|
|
|
String markmapToolbarJs = ''; |
|
|
|
String saveSvgAsPngJs = ''; |
|
|
|
|
|
|
|
RxBool isDownload = false.obs; |
|
|
|
RxDouble downloadProgress = 0.0.obs; |
|
|
|
|
|
|
|
String _systemPrompt = ''; |
|
|
|
String _userId = ''; |
|
|
|
|
|
|
|
@ -205,6 +211,30 @@ class MeetingDetailsController extends GetxController |
|
|
|
await rootBundle.loadString('assets/js/saveSvgAsPng.min.js'); |
|
|
|
} |
|
|
|
|
|
|
|
void downloadAudio() async { |
|
|
|
if (isDownload.value) return; |
|
|
|
isDownload.value = true; |
|
|
|
final directory = await getApplicationDocumentsDirectory(); |
|
|
|
final directoryDir = Directory('${directory.path}/DownloadAudio'); |
|
|
|
if (!await directoryDir.exists()) { |
|
|
|
await directoryDir.create(recursive: true); |
|
|
|
} |
|
|
|
final fileName = meetingData.value.audiourl.split('/').last; |
|
|
|
final String filePath = '${directory.path}/DownloadAudio/$fileName'; |
|
|
|
await Dio().download( |
|
|
|
meetingData.value.audiourl, |
|
|
|
filePath, |
|
|
|
onReceiveProgress: (int received, int total) { |
|
|
|
downloadProgress.value = total > 0 ? received / total : 0.0; |
|
|
|
}, |
|
|
|
); |
|
|
|
meetingData.value.filepath = filePath; |
|
|
|
meetingData.refresh(); |
|
|
|
_loadPlayerController(); |
|
|
|
SqfliteApi.editMeetingTitle(id, {'filePath': filePath}); |
|
|
|
isDownload.value = false; |
|
|
|
} |
|
|
|
|
|
|
|
void editSpeakerText() async { |
|
|
|
if (editSpeakerTextId.value != 0 && editSpeakerTextChange.isNotEmpty) { |
|
|
|
Map? foundElement = editSpeakerTextList.firstWhere( |
|
|
|
|