@ -13,7 +13,6 @@ import 'package:share_plus/share_plus.dart';
import ' package:webview_flutter/webview_flutter.dart ' ;
import ' package:webview_flutter/webview_flutter.dart ' ;
import ' ../../../../data/services/version_update_service.dart ' ;
import ' ../../../../data/services/network/dio_manager.dart ' ;
import ' ../../../../data/services/network/dio_manager.dart ' ;
import ' ../../controllers/meeting_details_controller.dart ' ;
import ' ../../controllers/meeting_details_controller.dart ' ;
import ' ../../controllers/mind_map_controller.dart ' ;
import ' ../../controllers/mind_map_controller.dart ' ;
@ -38,237 +37,243 @@ class _ShareBottomSheetState extends State<ShareBottomSheet> {
child: Column (
child: Column (
mainAxisSize: MainAxisSize . min ,
mainAxisSize: MainAxisSize . min ,
children: [
children: [
Container (
Container (
padding: EdgeInsets . symmetric ( vertical: 10. w ) ,
padding: EdgeInsets . symmetric ( vertical: 10. w ) ,
child: Row (
child: Row (
children: [
children: [
Icon (
Icon (
Icons . audio_file_outlined ,
Icons . audio_file_outlined ,
color: Colors . grey ,
color: Colors . grey ,
size: 32. w ,
size: 32. w ,
) ,
5. horizontalSpace ,
Expanded (
child: Text (
_controller . meetingData . value . title ,
style: TextStyle (
fontSize: 16. sp ,
color: Colors . black87 ,
) ,
) ,
) ,
) ,
5. horizontalSpace ,
GestureDetector (
Expanded (
onTap: ( ) = > Get . back ( ) ,
child: Text (
child: Container (
_controller . meetingData . value . title ,
width: 26. w ,
style: TextStyle (
height: 26. w ,
fontSize: 16. sp ,
decoration: BoxDecoration (
color: Colors . black87 ,
color: Colors . white ,
) ,
borderRadius: BorderRadius . circular ( 26. r ) ,
) ,
child: Icon (
Icons . close ,
size: 18. w ,
color: Colors . grey [ 400 ] ,
) ,
) ,
) ,
) ,
)
GestureDetector (
] ,
onTap: ( ) = > Get . back ( ) ,
child: Container (
width: 26. w ,
height: 26. w ,
decoration: BoxDecoration (
color: Colors . white ,
borderRadius: BorderRadius . circular ( 26. r ) ,
) ,
child: Icon (
Icons . close ,
size: 18. w ,
color: Colors . grey [ 400 ] ,
) ,
) ,
)
] ,
) ,
) ,
) ,
) ,
Padding (
Padding (
padding: EdgeInsets . symmetric ( vertical: 10. w ) ,
padding: EdgeInsets . symmetric ( vertical: 10. w ) ,
child: Column (
child: Column (
children: [
children: [
_box ( [
_box ( [
_shareItem (
_shareItem (
Icons . link ,
Icons . link ,
' shareLink ' . tr , / / 对 应 中 文 : 分 享 链 接
' shareLink ' . tr , / / 对 应 中 文 : 分 享 链 接
isBorder: false ,
onTap: ( ) async {
Get . back ( ) ;
final GetStorage storage = GetStorage ( ) ;
String token = storage . read ( " logintoken " ) ? ? ' ' ;
int id = _controller . meetingData . value . id ;
/ / final thumbnail = await getAssetThumbnailFile (
/ / ' assets/images/mine-background.png ' ,
/ / ' share_thumb.png ' ,
/ / ) ;
/ / 获 取 动 态 服 务 器 地 址
final serverUrl = DioManager ( ) . baseUrl ;
final serverHost = serverUrl
. replaceFirst ( ' https:// ' , ' ' )
. replaceFirst ( ' http:// ' , ' ' ) ;
final result = await SharePlus . instance . share ( ShareParams (
title: _controller . meetingData . value . title ,
subject:
' Voitrans WEB,由DeepSound.Ai提供支持-实时记录会议纪要,多语言翻译。 ' ,
uri: Uri . parse (
' https://share.deepechomeet.com/share/ $ serverHost /voitrans.net/ $ id / $ token ' ,
) ,
/ / previewThumbnail: thumbnail ,
) ) ;
if ( result . status = = ShareResultStatus . success ) {
EasyLoading . showToast ( ' shareSuccess ' . tr ) ; / / 对 应 中 文 : 分 享 完 成
}
} ,
) ,
] ) ,
_box ( [
_shareItem ( Icons . copy , ' copyTranscript ' . tr , / / 对 应 中 文 : 复 制 转 写
onTap: _controller . meetingDetails . value . tasktype > = 3 & &
_controller . meetingDetails . value . tasktype < 10002
? ( ) {
Get . back ( ) ;
_copy ( _getAllText ( ) ) ;
}
: null ) ,
_shareItem ( Icons . copy , ' copySummary ' . tr , / / 对 应 中 文 : 复 制 总 结
isBorder: false ,
isBorder: false ,
onTap: ( ) async {
Get . back ( ) ;
final GetStorage storage = GetStorage ( ) ;
String token = storage . read ( " logintoken " ) ? ? ' ' ;
int id = _controller . meetingData . value . id ;
/ / final thumbnail = await getAssetThumbnailFile (
/ / ' assets/images/mine-background.png ' ,
/ / ' share_thumb.png ' ,
/ / ) ;
/ / 获 取 动 态 服 务 器 地 址
final serverUrl = DioManager ( ) . baseUrl ;
final serverHost = serverUrl
. replaceFirst ( ' https:// ' , ' ' )
. replaceFirst ( ' http:// ' , ' ' ) ;
final result =
await SharePlus . instance . share ( ShareParams (
title: _controller . meetingData . value . title ,
subject:
' Voitrans WEB,由DeepSound.Ai提供支持-实时记录会议纪要,多语言翻译。 ' ,
uri: Uri . parse (
' https://share.deepechomeet.com/share/ $ serverHost /voitrans.net/ $ id / $ token ' ,
) ,
/ / previewThumbnail: thumbnail ,
) ) ;
if ( result . status = = ShareResultStatus . success ) {
EasyLoading . showToast ( ' shareSuccess ' . tr ) ; / / 对 应 中 文 : 分 享 完 成
}
} ,
) ,
] ) ,
_box ( [
_shareItem ( Icons . copy , ' copyTranscript ' . tr , / / 对 应 中 文 : 复 制 转 写
onTap: _controller . meetingDetails . value . tasktype > = 3 & &
_controller . meetingDetails . value . tasktype <
10002
? ( ) {
Get . back ( ) ;
_copy ( _getAllText ( ) ) ;
}
: null ) ,
_shareItem ( Icons . copy , ' copySummary ' . tr , / / 对 应 中 文 : 复 制 总 结
isBorder: false ,
onTap: _controller . meetingDetails . value . tasktype > = 5 & &
_controller . meetingDetails . value . tasktype <
10001
? ( ) {
Get . back ( ) ;
_copy ( _markdownToPlainText (
_controller . meetingDetails . value . summary ) ) ;
}
: null ) ,
] ) ,
_box ( [
_shareItem (
Icons . multitrack_audio , ' exportAudio ' . tr , / / 对 应 中 文 : 导 出 音 频
onTap: ( ) {
Get . back ( ) ;
_share ( _controller . meetingData . value . filepath ,
' shareMeetingAudio ' . tr ) ; / / 对 应 中 文 : 分 享 会 议 音 频
} ) ,
_shareItem (
Icons . message , ' exportTranscript ' . tr , / / 对 应 中 文 : 导 出 转 写
onTap: _controller . meetingDetails . value . tasktype > = 3 & &
_controller . meetingDetails . value . tasktype <
10002
? ( ) async {
Get . back ( ) ;
final tempDir = await getTemporaryDirectory ( ) ;
final file = File (
' ${ tempDir . path } / ${ _controller . meetingData . value . title } _speaker.txt ' ) ;
String allText = _getAllText ( ) ;
await file . writeAsString ( allText ) ;
_share ( file . path ,
' exportTranscript ' . tr ) ; / / 对 应 中 文 : 分 享 会 议 转 写
}
: null ) ,
_shareItem ( Icons . article , ' exportSummary ' . tr , / / 对 应 中 文 : 导 出 总 结
onTap: _controller . meetingDetails . value . tasktype > = 5 & &
_controller . meetingDetails . value . tasktype <
10001
? ( ) async {
Get . back ( ) ;
Get . bottomSheet (
SecondLevelBottomSheet (
' exportSummary ' . tr , / / 对 应 中 文 : 导 出 总 结
' exportAs ' . tr , / / 对 应 中 文 : 导 出 为
( int index ) async {
if ( index = = 0 ) {
/ / 导 出 TXT
final tempDir =
await getTemporaryDirectory ( ) ;
final file = File (
' ${ tempDir . path } / ${ _controller . meetingData . value . title } _summary.txt ' ) ;
await file . writeAsString (
_markdownToPlainText ( _controller
. meetingDetails . value . summary ) ) ;
_share ( file . path ,
' exportSummary ' . tr ) ; / / 对 应 中 文 : 分 享 会 议 总 结
} else {
/ / 导 出 PDF
_exportMarkdownPdf ( ) ;
}
} ,
const [
{
' icon ' : Icons . text_snippet ,
' title ' : ' TXT ' ,
' isBorder ' : true ,
} ,
{
' icon ' : Icons . picture_as_pdf ,
' title ' : ' PDF ' ,
' isBorder ' : false ,
} ,
] ,
) ,
isScrollControlled: true ,
backgroundColor: Colors . grey [ 100 ] ,
shape: RoundedRectangleBorder (
borderRadius: BorderRadius . vertical (
top: Radius . circular ( 12. r ) ,
) ,
) ,
) ;
}
: null ) ,
_shareItem (
Icons . save_alt ,
' saveMindMap ' . tr ,
onTap: _controller . meetingDetails . value . tasktype > = 5 & &
onTap: _controller . meetingDetails . value . tasktype > = 5 & &
_controller . meetingDetails . value . tasktype < 10001
_controller . meetingDetails . value . tasktype < 10001
? ( ) {
? ( ) {
Get . back ( ) ;
Get . back ( ) ;
_copy ( _markdownToPlainText (
final mindMapController =
_controller . meetingDetails . value . summary ) ) ;
Get . find < MindMapController > ( ) ;
}
mindMapController . imageType = 1 ;
: null ) ,
if ( mindMapController . isWebViewReady ) {
] ) ,
mindMapController . webViewController
_box ( [
. runJavaScript ( ' captureImage() ' ) ;
_shareItem (
} else {
Icons . multitrack_audio , ' exportAudio ' . tr , / / 对 应 中 文 : 导 出 音 频
mindMapController . webViewController
onTap: ( ) {
. setNavigationDelegate (
Get . back ( ) ;
NavigationDelegate (
_share ( _controller . meetingData . value . filepath ,
onPageFinished: ( String url ) {
' shareMeetingAudio ' . tr ) ; / / 对 应 中 文 : 分 享 会 议 音 频
mindMapController . isWebViewReady = true ;
} ) ,
mindMapController . webViewController
_shareItem ( Icons . message , ' exportTranscript ' . tr , / / 对 应 中 文 : 导 出 转 写
. runJavaScript ( ' captureImage() ' ) ;
onTap: _controller . meetingDetails . value . tasktype > = 3 & &
} ,
_controller . meetingDetails . value . tasktype < 10002
) ,
? ( ) async {
) ;
Get . back ( ) ;
}
final tempDir = await getTemporaryDirectory ( ) ;
final file = File (
' ${ tempDir . path } / ${ _controller . meetingData . value . title } _speaker.txt ' ) ;
String allText = _getAllText ( ) ;
await file . writeAsString ( allText ) ;
_share ( file . path ,
' exportTranscript ' . tr ) ; / / 对 应 中 文 : 分 享 会 议 转 写
}
}
: null ) ,
: null ,
_shareItem ( Icons . article , ' exportSummary ' . tr , / / 对 应 中 文 : 导 出 总 结
) ,
_shareItem (
Icons . lan ,
' shareMindMap ' . tr , / / 对 应 中 文 : 分 享 思 维 导 图
isBorder: false ,
onTap: _controller . meetingDetails . value . tasktype > = 5 & &
onTap: _controller . meetingDetails . value . tasktype > = 5 & &
_controller . meetingDetails . value . tasktype < 10001
_controller . meetingDetails . value . tasktype < 10001
? ( ) async {
? ( ) {
Get . back ( ) ;
Get . back ( ) ;
Get . bottomSheet (
final mindMapController =
SecondLevelBottomSheet (
Get . find < MindMapController > ( ) ;
' exportSummary ' . tr , / / 对 应 中 文 : 导 出 总 结
mindMapController . imageType = 2 ;
' exportAs ' . tr , / / 对 应 中 文 : 导 出 为
if ( mindMapController . isWebViewReady ) {
( int index ) async {
mindMapController . webViewController
if ( index = = 0 ) {
. runJavaScript ( ' captureImage() ' ) ;
/ / 导 出 TXT
} else {
final tempDir =
mindMapController . webViewController
await getTemporaryDirectory ( ) ;
. setNavigationDelegate (
final file = File (
NavigationDelegate (
' ${ tempDir . path } / ${ _controller . meetingData . value . title } _summary.txt ' ) ;
onPageFinished: ( String url ) {
await file . writeAsString (
mindMapController . isWebViewReady = true ;
_markdownToPlainText ( _controller
mindMapController . webViewController
. meetingDetails . value . summary ) ) ;
. runJavaScript ( ' captureImage() ' ) ;
_share ( file . path ,
' exportSummary ' . tr ) ; / / 对 应 中 文 : 分 享 会 议 总 结
} else {
/ / 导 出 PDF
_exportMarkdownPdf ( ) ;
}
} ,
const [
{
' icon ' : Icons . text_snippet ,
' title ' : ' TXT ' ,
' isBorder ' : true ,
} ,
} ,
{
' icon ' : Icons . picture_as_pdf ,
' title ' : ' PDF ' ,
' isBorder ' : false ,
} ,
] ,
) ,
isScrollControlled: true ,
backgroundColor: Colors . grey [ 100 ] ,
shape: RoundedRectangleBorder (
borderRadius: BorderRadius . vertical (
top: Radius . circular ( 12. r ) ,
) ,
) ,
) ,
) ;
) ;
}
}
: null ) ,
_shareItem (
Icons . save_alt ,
' 保存思维导图 ' ,
onTap: _controller . meetingDetails . value . tasktype > = 5 & &
_controller . meetingDetails . value . tasktype < 10001
? ( ) {
Get . back ( ) ;
final mindMapController =
Get . find < MindMapController > ( ) ;
mindMapController . imageType = 1 ;
if ( mindMapController . isWebViewReady ) {
mindMapController . webViewController
. runJavaScript ( ' captureImage() ' ) ;
} else {
mindMapController . webViewController
. setNavigationDelegate (
NavigationDelegate (
onPageFinished: ( String url ) {
mindMapController . isWebViewReady = true ;
mindMapController . webViewController
. runJavaScript ( ' captureImage() ' ) ;
} ,
) ,
) ;
}
}
: null ,
) ,
_shareItem (
Icons . lan ,
' shareMindMap ' . tr , / / 对 应 中 文 : 分 享 思 维 导 图
isBorder: false ,
onTap: _controller . meetingDetails . value . tasktype > = 5 & &
_controller . meetingDetails . value . tasktype < 10001
? ( ) {
Get . back ( ) ;
final mindMapController =
Get . find < MindMapController > ( ) ;
mindMapController . imageType = 2 ;
if ( mindMapController . isWebViewReady ) {
mindMapController . webViewController
. runJavaScript ( ' captureImage() ' ) ;
} else {
mindMapController . webViewController
. setNavigationDelegate (
NavigationDelegate (
onPageFinished: ( String url ) {
mindMapController . isWebViewReady = true ;
mindMapController . webViewController
. runJavaScript ( ' captureImage() ' ) ;
} ,
) ,
) ;
}
}
}
: null ,
: null ,
) ,
) ,
] ) ,
] ) ,
] ,
] ,
) ,
) ,
) ,
) ,
] ,
] ,
) ,
) ,
) ,
) ,