|
|
|
@ -84,7 +84,7 @@ class VoiceReplicationView extends GetView<VoiceReplicationController> { |
|
|
|
Padding( |
|
|
|
padding: EdgeInsets.only(top: 20.w, bottom: 10.w), |
|
|
|
child: Text( |
|
|
|
'复刻你的声音', |
|
|
|
'首月免费使用', |
|
|
|
style: TextStyle( |
|
|
|
color: isDarkMode ? Colors.white : Colors.black87, |
|
|
|
fontSize: 18.sp, |
|
|
|
@ -105,6 +105,7 @@ class VoiceReplicationView extends GetView<VoiceReplicationController> { |
|
|
|
), |
|
|
|
Container( |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 2.w), |
|
|
|
margin: EdgeInsets.only(bottom: 15.w), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: isDarkMode ? Colors.grey[800] : Colors.white, |
|
|
|
borderRadius: BorderRadius.circular(12.w), |
|
|
|
@ -122,31 +123,78 @@ class VoiceReplicationView extends GetView<VoiceReplicationController> { |
|
|
|
() => Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
Row( |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
children: [ |
|
|
|
Text( |
|
|
|
'开启声音复刻', |
|
|
|
style: TextStyle( |
|
|
|
color: isDarkMode ? Colors.white : Colors.black87, |
|
|
|
fontSize: 16.sp, |
|
|
|
), |
|
|
|
), |
|
|
|
Transform.scale( |
|
|
|
scale: 0.9, |
|
|
|
alignment: Alignment.centerRight, |
|
|
|
child: Switch( |
|
|
|
value: controller.isReplicating.value, |
|
|
|
onChanged: controller.switchChange, |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
_buildSwitch( |
|
|
|
isDarkMode, |
|
|
|
'开启声音复刻', |
|
|
|
controller.isReplicating.value, |
|
|
|
onChanged: (bool value) { |
|
|
|
controller.isReplicating.value = value; |
|
|
|
controller.enableVoiceFlocking(); |
|
|
|
}, |
|
|
|
), |
|
|
|
if (controller.isReplicating.value) _buildOpen(isDarkMode), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
Obx( |
|
|
|
() => controller.isReplicating.value |
|
|
|
? Container( |
|
|
|
padding: |
|
|
|
EdgeInsets.symmetric(horizontal: 12.w, vertical: 5.w), |
|
|
|
margin: EdgeInsets.only(bottom: 15.w), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: isDarkMode ? Colors.grey[800] : Colors.white, |
|
|
|
borderRadius: BorderRadius.circular(12.w), |
|
|
|
boxShadow: [ |
|
|
|
BoxShadow( |
|
|
|
color: isDarkMode |
|
|
|
? Colors.black.withValues(alpha: 0.2) |
|
|
|
: Colors.black.withValues(alpha: 0.05), |
|
|
|
blurRadius: 10, |
|
|
|
offset: const Offset(0, 4), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
_buildSwitch( |
|
|
|
isDarkMode, |
|
|
|
'AI全能助手开启', |
|
|
|
controller.isAgent.value, |
|
|
|
onChanged: (bool value) { |
|
|
|
controller.isAgent.value = value; |
|
|
|
}, |
|
|
|
), |
|
|
|
_buildSwitch( |
|
|
|
isDarkMode, |
|
|
|
'同声翻译开启', |
|
|
|
controller.isSimultaneous.value, |
|
|
|
onChanged: (bool value) { |
|
|
|
controller.isSimultaneous.value = value; |
|
|
|
}, |
|
|
|
), |
|
|
|
_buildSwitch( |
|
|
|
isDarkMode, |
|
|
|
'通话翻译开启', |
|
|
|
controller.isCall.value, |
|
|
|
onChanged: (bool value) { |
|
|
|
controller.isCall.value = value; |
|
|
|
}, |
|
|
|
), |
|
|
|
_buildSwitch( |
|
|
|
isDarkMode, |
|
|
|
'面对面翻译开启', |
|
|
|
controller.isFaceToFace.value, |
|
|
|
onChanged: (bool value) { |
|
|
|
controller.isFaceToFace.value = value; |
|
|
|
}, |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
) |
|
|
|
: const SizedBox.shrink(), |
|
|
|
), |
|
|
|
], |
|
|
|
); |
|
|
|
} |
|
|
|
@ -156,7 +204,7 @@ class VoiceReplicationView extends GetView<VoiceReplicationController> { |
|
|
|
padding: EdgeInsets.symmetric(vertical: 10.w), |
|
|
|
child: controller.speakerProfileId.value.isNotEmpty |
|
|
|
? Text( |
|
|
|
'个人语音ID:${controller.speakerProfileId.value}', |
|
|
|
'个人语音ID:\n${controller.speakerProfileId.value}', |
|
|
|
style: TextStyle( |
|
|
|
color: isDarkMode ? Colors.white : Colors.grey, |
|
|
|
fontSize: 14.sp, |
|
|
|
@ -200,4 +248,35 @@ class VoiceReplicationView extends GetView<VoiceReplicationController> { |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
Widget _buildSwitch( |
|
|
|
bool isDarkMode, |
|
|
|
String title, |
|
|
|
bool value, { |
|
|
|
Function(bool)? onChanged, |
|
|
|
}) { |
|
|
|
return Padding( |
|
|
|
padding: EdgeInsets.symmetric(vertical: 2.w), |
|
|
|
child: Row( |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
children: [ |
|
|
|
Text( |
|
|
|
title, |
|
|
|
style: TextStyle( |
|
|
|
color: isDarkMode ? Colors.white : Colors.black87, |
|
|
|
fontSize: 16.sp, |
|
|
|
), |
|
|
|
), |
|
|
|
Transform.scale( |
|
|
|
scale: 0.8, |
|
|
|
alignment: Alignment.centerRight, |
|
|
|
child: Switch( |
|
|
|
value: value, |
|
|
|
onChanged: onChanged, |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|