@ -93,285 +93,288 @@ class _GenerateBottomSheetState extends State<GenerateBottomSheet> {
child: Column (
mainAxisSize: MainAxisSize . min ,
children: [
Container (
padding: EdgeInsets . symmetric ( horizontal: 12. w , vertical: 10. w ) ,
child: Row (
children: [
Icon (
Icons . audio_file_outlined ,
color: Colors . grey ,
size: 32. w ,
) ,
5. horizontalSpace ,
Expanded (
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Text (
_controller . meetingData . value . title ,
style: TextStyle (
fontSize: 16. sp ,
color: Colors . black87 ,
Container (
padding: EdgeInsets . symmetric ( horizontal: 12. w , vertical: 10. w ) ,
child: Row (
children: [
Icon (
Icons . audio_file_outlined ,
color: Colors . grey ,
size: 32. w ,
) ,
5. horizontalSpace ,
Expanded (
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Text (
_controller . meetingData . value . title ,
style: TextStyle (
fontSize: 16. sp ,
color: Colors . black87 ,
) ,
) ,
) ,
Text (
' ${ _controller . meetingData . value . seconds } s ' ,
style: TextStyle (
fontSize: 12. sp ,
color: Colors . grey ,
Text (
' ${ _controller . meetingData . value . seconds } s ' ,
style: TextStyle (
fontSize: 12. sp ,
color: Colors . grey ,
) ,
) ,
) ,
] ,
) ,
) ,
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 ] ,
) ,
) ,
)
] ,
) ,
) ,
Container (
padding: EdgeInsets . symmetric ( horizontal: 12. w ) ,
margin: EdgeInsets . only ( bottom: 10. w ) ,
child: Divider (
height: 1 ,
color: Colors . grey [ 300 ] ,
) ,
) ,
Padding (
padding: EdgeInsets . symmetric ( horizontal: 12. w , vertical: 10. w ) ,
child: Row (
children: [
Expanded (
child: Text (
' selectSummaryTemplate ' . tr , / / 对 应 中 文 : 选 择 总 结 模 版
style: TextStyle (
fontSize: 14. sp ,
color: Colors . black87 ,
] ,
) ,
) ,
) ,
GestureDetector (
onTap: ( ) async {
var result = await Get . to (
( ) = > TemplateView (
_templateData ,
_lastTemplateData [ ' id ' ] ? ? 0 ,
GestureDetector (
onTap: ( ) = > Get . back ( ) ,
child: Container (
width: 26. w ,
height: 26. w ,
decoration: BoxDecoration (
color: Colors . white ,
borderRadius: BorderRadius . circular ( 26. r ) ,
) ,
preventDuplicates: false ,
) ;
if ( result ! = null ) {
_scrollController . jumpTo ( 0 ) ;
List list = List . from ( _originalTemplate ) ;
int index = list
. indexWhere ( ( element ) = > element [ ' id ' ] = = result [ ' id ' ] ) ;
if ( index ! = - 1 ) {
Map itemToMove = list . removeAt ( index ) ;
list . insert ( 0 , itemToMove ) ;
} else {
list . insert ( 0 , result ) ;
}
setState ( ( ) {
_templateData = result ;
_templateList = list ;
} ) ;
}
if ( _controller . editTemplate . isNotEmpty ) {
Map ? editMap = _templateList . firstWhere (
( element ) = >
element [ ' id ' ] = = _controller . editTemplate [ ' id ' ] ,
orElse: ( ) = > null ) ;
if ( editMap ! = null ) {
editMap [ ' name ' ] = _controller . editTemplate [ ' name ' ] ;
editMap [ ' desc ' ] = _controller . editTemplate [ ' desc ' ] ;
editMap [ ' prompt ' ] = _controller . editTemplate [ ' prompt ' ] ;
}
if ( _controller . editTemplate [ ' id ' ] = = _templateData [ ' id ' ] ) {
_templateData [ ' name ' ] = _controller . editTemplate [ ' name ' ] ;
_templateData [ ' desc ' ] = _controller . editTemplate [ ' desc ' ] ;
_templateData [ ' prompt ' ] =
_controller . editTemplate [ ' prompt ' ] ;
}
setState ( ( ) { } ) ;
}
if ( _controller . deleteTemplateId ! = 0 ) {
_templateList . removeWhere ( ( element ) = >
element [ ' id ' ] = = _controller . deleteTemplateId ) ;
if ( _controller . deleteTemplateId = = _templateData [ ' id ' ] ) {
_templateData = _templateList [ 0 ] ;
}
setState ( ( ) { } ) ;
_storage . write ( " meeting_last_template_Data " , { } ) ;
_storage . write ( " meeting_template_list " , _templateList ) ;
}
} ,
child: Row (
children: [
Text (
' viewAll ' . tr , / / 对 应 中 文 : 查 看 全 部
style: TextStyle (
fontSize: 12. sp ,
color: Colors . grey ,
) ,
child: Icon (
Icons . close ,
size: 18. w ,
color: Colors . grey [ 400 ] ,
) ,
const Icon (
Icons . keyboard_arrow_right ,
color: Colors . grey ,
)
] ,
) ,
) ,
] ,
) ,
) ,
Container (
height: 130. w ,
margin: EdgeInsets . only ( bottom: 16. w ) ,
child: ListView . builder (
controller: _scrollController ,
itemCount: _templateList . length ,
scrollDirection: Axis . horizontal ,
padding: EdgeInsets . symmetric ( horizontal: 4. w ) ,
itemBuilder: ( BuildContext context , int index ) {
Map data = _templateList [ index ] ;
return _item ( data ) ;
} ,
) ,
)
] ,
) ,
) ,
) ,
if ( ! widget . isSummarizeAgain )
Container (
margin: EdgeInsets . symmetric ( horizontal: 12. w ) ,
decoration: BoxDecoration (
color: Colors . white ,
borderRadius: BorderRadius . circular ( 8. r ) ,
padding: EdgeInsets . symmetric ( horizontal: 12. w ) ,
margin: EdgeInsets . only ( bottom: 10. w ) ,
child: Divider (
height: 1 ,
color: Colors . grey [ 300 ] ,
) ,
child: Column (
) ,
Padding (
padding: EdgeInsets . symmetric ( horizontal: 12. w , vertical: 10. w ) ,
child: Row (
children: [
_row (
' speakerIdentification ' . tr , / / 对 应 中 文 : 区 分 说 话 人
widget: Transform . scale (
scale: 0.8 ,
alignment: Alignment . centerRight ,
child: Switch (
value: _isSpeaker ,
onChanged: ( bool value ) {
setState ( ( ) {
_isSpeaker = value ;
} ) ;
} ,
Expanded (
child: Text (
' selectSummaryTemplate ' . tr , / / 对 应 中 文 : 选 择 总 结 模 版
style: TextStyle (
fontSize: 14. sp ,
color: Colors . black87 ,
) ,
) ,
) ,
_row (
' recordingLanguage ' . tr , / / 对 应 中 文 : 录 音 语 言
value: _formlanguageText ,
onTap: ( ) {
Get . bottomSheet (
RecordLanguageBottomSheet ( _formlanguage ) ,
isScrollControlled: true ,
backgroundColor: Colors . grey [ 100 ] ,
shape: RoundedRectangleBorder (
borderRadius: BorderRadius . vertical (
top: Radius . circular ( 12. r ) ,
) ,
GestureDetector (
onTap: ( ) async {
var result = await Get . to (
( ) = > TemplateView (
_templateData ,
_lastTemplateData [ ' id ' ] ? ? 0 ,
) ,
) . then ( ( value ) {
if ( value ! = null ) {
setState ( ( ) {
_formlanguageText = value [ ' name ' ] ;
_formlanguage = value [ ' value ' ] ;
} ) ;
preventDuplicates: false ,
) ;
if ( result ! = null ) {
_scrollController . jumpTo ( 0 ) ;
List list = List . from ( _originalTemplate ) ;
int index = list . indexWhere (
( element ) = > element [ ' id ' ] = = result [ ' id ' ] ) ;
if ( index ! = - 1 ) {
Map itemToMove = list . removeAt ( index ) ;
list . insert ( 0 , itemToMove ) ;
} else {
list . insert ( 0 , result ) ;
}
setState ( ( ) {
_templateData = result ;
_templateList = list ;
} ) ;
}
if ( _controller . editTemplate . isNotEmpty ) {
Map ? editMap = _templateList . firstWhere (
( element ) = >
element [ ' id ' ] = = _controller . editTemplate [ ' id ' ] ,
orElse: ( ) = > null ) ;
if ( editMap ! = null ) {
editMap [ ' name ' ] = _controller . editTemplate [ ' name ' ] ;
editMap [ ' desc ' ] = _controller . editTemplate [ ' desc ' ] ;
editMap [ ' prompt ' ] = _controller . editTemplate [ ' prompt ' ] ;
}
if ( _controller . editTemplate [ ' id ' ] = =
_templateData [ ' id ' ] ) {
_templateData [ ' name ' ] =
_controller . editTemplate [ ' name ' ] ;
_templateData [ ' desc ' ] =
_controller . editTemplate [ ' desc ' ] ;
_templateData [ ' prompt ' ] =
_controller . editTemplate [ ' prompt ' ] ;
}
setState ( ( ) { } ) ;
}
if ( _controller . deleteTemplateId ! = 0 ) {
_templateList . removeWhere ( ( element ) = >
element [ ' id ' ] = = _controller . deleteTemplateId ) ;
if ( _controller . deleteTemplateId = = _templateData [ ' id ' ] ) {
_templateData = _templateList [ 0 ] ;
}
} ) ;
setState ( ( ) { } ) ;
_storage . write ( " meeting_last_template_Data " , { } ) ;
_storage . write ( " meeting_template_list " , _templateList ) ;
}
} ,
) ,
_row (
' targetLanguage ' . tr , / / 对 应 中 文 : 目 标 语 言
value: _tolanguageText ,
isBorder: false ,
onTap: ( ) {
Get . bottomSheet (
RecordLanguageBottomSheet ( _tolanguage ) ,
isScrollControlled: true ,
backgroundColor: Colors . grey [ 100 ] ,
shape: RoundedRectangleBorder (
borderRadius: BorderRadius . vertical (
top: Radius . circular ( 12. r ) ,
child: Row (
children: [
Text (
' viewAll ' . tr , / / 对 应 中 文 : 查 看 全 部
style: TextStyle (
fontSize: 12. sp ,
color: Colors . grey ,
) ,
) ,
) . then ( ( value ) {
if ( value ! = null ) {
setState ( ( ) {
_tolanguageText = value [ ' name ' ] ;
_tolanguage = value [ ' value ' ] ;
} ) ;
}
} ) ;
} ,
const Icon (
Icons . keyboard_arrow_right ,
color: Colors . grey ,
)
] ,
) ,
) ,
] ,
) ,
) ,
Padding (
padding: EdgeInsets . symmetric ( horizontal: 12. w , vertical: 20. w ) ,
child: GestureDetector (
onTap: ( ) {
if ( User . isLoggedIn ( ) & & User . instance . meetintegral < = 0 ) {
showRechargeDialog ( ' meeting ' ) ;
return ;
}
if ( _templateData [ ' id ' ] ! = _templateList [ 0 ] [ ' id ' ] ) {
int index = _templateList
. indexWhere ( ( v ) = > v [ ' id ' ] = = _templateData [ ' id ' ] ) ;
if ( index ! = - 1 ) {
Map itemToMove = _templateList . removeAt ( index ) ;
_templateList . insert ( 0 , itemToMove ) ;
}
}
_storage . write ( " meeting_last_template_Data " , _templateData ) ;
_storage . write ( " meeting_template_list " , _templateList ) ;
Get . back ( ) ;
if ( widget . isSummarizeAgain ) {
_controller . refreshSummary ( _templateData [ ' id ' ] ) ;
} else {
_controller . summaryCreate (
_formlanguage ,
_tolanguage ,
_isSpeaker ,
_templateData [ ' id ' ] ,
) ;
}
} ,
child: Container (
height: 48. w ,
alignment: Alignment . center ,
Container (
height: 130. w ,
margin: EdgeInsets . only ( bottom: 16. w ) ,
child: ListView . builder (
controller: _scrollController ,
itemCount: _templateList . length ,
scrollDirection: Axis . horizontal ,
padding: EdgeInsets . symmetric ( horizontal: 4. w ) ,
itemBuilder: ( BuildContext context , int index ) {
Map data = _templateList [ index ] ;
return _item ( data ) ;
} ,
) ,
) ,
if ( ! widget . isSummarizeAgain )
Container (
margin: EdgeInsets . symmetric ( horizontal: 12. w ) ,
decoration: BoxDecoration (
color: Colors . black ,
borderRadius: BorderRadius . circular ( 12 .r ) ,
color: Colors . white ,
borderRadius: BorderRadius . circular ( 8. r ) ,
) ,
child: Text (
' meetingGenerateNow ' . tr , / / 对 应 中 文 : 立 即 生 成
style: TextStyle (
fontSize: 16. sp ,
color: Colors . white ,
child: Column (
children: [
_row (
' speakerIdentification ' . tr , / / 对 应 中 文 : 区 分 说 话 人
widget: Transform . scale (
scale: 0.8 ,
alignment: Alignment . centerRight ,
child: Switch (
value: _isSpeaker ,
onChanged: ( bool value ) {
setState ( ( ) {
_isSpeaker = value ;
} ) ;
} ,
) ,
) ,
) ,
_row (
' recordingLanguage ' . tr , / / 对 应 中 文 : 录 音 语 言
value: _formlanguageText ,
onTap: ( ) {
Get . bottomSheet (
RecordLanguageBottomSheet ( _formlanguage ) ,
isScrollControlled: true ,
backgroundColor: Colors . grey [ 100 ] ,
shape: RoundedRectangleBorder (
borderRadius: BorderRadius . vertical (
top: Radius . circular ( 12. r ) ,
) ,
) ,
) . then ( ( value ) {
if ( value ! = null ) {
setState ( ( ) {
_formlanguageText = value [ ' name ' ] ;
_formlanguage = value [ ' value ' ] ;
} ) ;
}
} ) ;
} ,
) ,
_row (
' targetLanguage ' . tr , / / 对 应 中 文 : 目 标 语 言
value: _tolanguageText ,
isBorder: false ,
onTap: ( ) {
Get . bottomSheet (
RecordLanguageBottomSheet ( _tolanguage ) ,
isScrollControlled: true ,
backgroundColor: Colors . grey [ 100 ] ,
shape: RoundedRectangleBorder (
borderRadius: BorderRadius . vertical (
top: Radius . circular ( 12. r ) ,
) ,
) ,
) . then ( ( value ) {
if ( value ! = null ) {
setState ( ( ) {
_tolanguageText = value [ ' name ' ] ;
_tolanguage = value [ ' value ' ] ;
} ) ;
}
} ) ;
} ,
) ,
] ,
) ,
) ,
Padding (
padding: EdgeInsets . symmetric ( horizontal: 12. w , vertical: 20. w ) ,
child: GestureDetector (
onTap: ( ) {
if ( User . isLoggedIn ( ) & & User . instance . meetintegral < = 0 ) {
showRechargeDialog ( ' meeting ' ) ;
return ;
}
if ( _templateData [ ' id ' ] ! = _templateList [ 0 ] [ ' id ' ] ) {
int index = _templateList
. indexWhere ( ( v ) = > v [ ' id ' ] = = _templateData [ ' id ' ] ) ;
if ( index ! = - 1 ) {
Map itemToMove = _templateList . removeAt ( index ) ;
_templateList . insert ( 0 , itemToMove ) ;
}
}
_storage . write ( " meeting_last_template_Data " , _templateData ) ;
_storage . write ( " meeting_template_list " , _templateList ) ;
Get . back ( ) ;
if ( widget . isSummarizeAgain ) {
_controller . refreshSummary ( _templateData [ ' id ' ] ) ;
} else {
_controller . summaryCreate (
_formlanguage ,
_tolanguage ,
_isSpeaker ,
_templateData [ ' id ' ] ,
) ;
}
} ,
child: Container (
height: 48. w ,
alignment: Alignment . center ,
decoration: BoxDecoration (
color: Colors . black ,
borderRadius: BorderRadius . circular ( 12. r ) ,
) ,
child: Text (
' meetingGenerateNow ' . tr , / / 对 应 中 文 : 立 即 生 成
style: TextStyle (
fontSize: 16. sp ,
color: Colors . white ,
) ,
) ,
) ,
) ,
) ,
) ,
] ,
) ,
) ;